在本文中,我们将给您介绍关于Python安装setuptools时报Compressionrequiresthe(missing)zlib的详细内容,并且为您解答python安装setuptools报
在本文中,我们将给您介绍关于Python 安装 setuptools 时报 Compression requires the (missing) zlib的详细内容,并且为您解答python安装setuptools报错的相关问题,此外,我们还将为您提供关于"One or more types required to compile a dynamic expression cannot be found. Are you missing...、Access restriction: The type BASE64Encoder is not accessible due to restrict on required library、An application is attempting to perform an action that requires privileges. Authentication is requir、Apache Shiro 使用 RequiresPermissions with Spring...的知识。
本文目录一览:- Python 安装 setuptools 时报 Compression requires the (missing) zlib(python安装setuptools报错)
- "One or more types required to compile a dynamic expression cannot be found. Are you missing...
- Access restriction: The type BASE64Encoder is not accessible due to restrict on required library
- An application is attempting to perform an action that requires privileges. Authentication is requir
- Apache Shiro 使用 RequiresPermissions with Spring...
Python 安装 setuptools 时报 Compression requires the (missing) zlib(python安装setuptools报错)
装机员为您提供 Python 安装 setuptools 时报 Compression requires the (missing) zlib 的文章咨询供您阅读,如何使用 Python 安装 setuptools 时报 Compression requires the (missing) zlib 的方法对您有帮助也请您举手之劳分享给您身边的人。
背景:虚拟机 CentOS 下安装 Python 辅助工具 setuptools 报错,错误信息大概如下:
Traceback (most recent call last):
File "setup.py", line 94, in <module>
scripts = scripts,
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/Oracle/sor/install/setuptools-0.6c11/setuptools/command/install.py", line 76, in run
self.do_egg_install()
File "/opt/oracle/sor/install/setuptools-0.6c11/setuptools/command/install.py", line 96, in do_egg_install
self.run_command('bdist_egg')
File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/oracle/sor/install/setuptools-0.6c11/setuptools/command/bdist_egg.py", line 236, in run
dry_run=self.dry_run, mode=self.gen_header())
File "/opt/oracle/sor/install/setuptools-0.6c11/setuptools/command/bdist_egg.py", line 527, in make_zipfile
z = zipfile.ZipFile(zip_filename, mode, compression=compression)
File "/usr/local/lib/python2.7/zipfile.py", line 681, in __init__
"Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module
出错原因:
提示的很清楚,缺少 zlib 模块导致安装失败
解决方式:
# yum install zlib
# yum install zlib-devel
下载成功后,进入 python2.7 的目录,重新执行
#make
#make install
此时先前执行的 软连接仍旧生效
然后进入 setuptool 目录,
[root@localhost setuptools-5.2]# pythonnew setup.py install 重新安装
基本这样就可以搞定。
"One or more types required to compile a dynamic expression cannot be found. Are you missing...
#事故现场:
在一个.net 4.0 的项目中使用 dynamic,示例代码如下:
1 private static void Main(string[] args)
2 {
3 dynamic obj;
4 obj = new { name = "jack" };
5 Console.WriteLine(obj.name);
6 }
在读取 obj.name 时,报错:
One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?
#解决方法:
在项目中,添加 Microsoft.CSharp.dll 的引用;
#参考:
https://stackoverflow.com/questions/11725514/one-or-more-types-required-to-compile-a-dynamic-expression-cannot-be-found-are
——————————————————————————————————————————————————
Access restriction: The type BASE64Encoder is not accessible due to restrict on required library
今天在写一个WebService程序时,用到了sun.misc.BASE64Encoder().encode(baos.toByteArray()); 但遇到了一个错误:
Access restriction: The type BASE64Encoder is not accessible due to restrict on required library java/lib/rt.jar。
导入了这个jar可是还是不行,于是查了一下,解决方法是在project的build path里先删除JRE System Library,然后再添加一遍,就好了。
我也不知道为什么这么做,求大神解释~~
An application is attempting to perform an action that requires privileges. Authentication is requir
An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
resolve : sudo command...
Apache Shiro 使用 RequiresPermissions with Spring...
Via:http://zhidao.baidu.com/question/397868108.html
http://yingzhuo.iteye.com/blog/1709002
根据官方文档在启用Shiro 注解(例如,@RequiresRoles,@RequiresPermissions 等等)时,
需要Shiro 的Spring AOP 集成来扫描合适的注解类以及执行必要的安全逻辑。
只需添加这两个bean 定义到applicationContext-shiro.xml 中:
<beandepends-on="lifecycleBeanPostProcessor"/>
<bean>
<property name="securityManager" ref="securityManager"/>
</bean>
但是,在使用Spring MVC 的情况下,会遇到:
Exception: org.hibernate.HibernateException: No Session found for current thread
解决方法:
将以上代码移至Spring MVC 的servlet 配置文件,如:applicationContext-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
<!-- Scans the classpath of this application for @Components to deploy as beans -->
<!-- 只应加装表现层Bean,否则可能引起问题 -->
<!-- 此处只应该加载表现层组件,如果此处还加载dao层或service层的bean会将之前容器加载的替换掉,而且此处不会进行AOP织入,所以会造成AOP失效问题(如事务不起作用) -->
<context:component-scan base-package="com.binaryoptions.controller">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- 其他spring-mvc框架配置 -->
<bean id="viewResolver"
p:view p:prefix="/views/"
p:suffix=".jsp" />
<!-- more bean definitions go here -->
<!-- 为安全检查使用Shiro 的注解(例如,@RequiresRoles,@RequiresPermissions 等等)。 -->
<!--
以下两个bean的配置是为了在Controller层使用元注释控制权限
如果使用spring-mvc一定要不要放在webroot的配置文件中
-->
<beandepends-on="lifecycleBeanPostProcessor"/>
<bean>
<property name="securityManager" ref="securityManager"/>
</bean>
<bean>
<property name="exceptionMappings">
<props>
<prop key="org.apache.shiro.authz.UnauthorizedException">/403</prop>
</props>
</property>
</bean>
</beans>
今天关于Python 安装 setuptools 时报 Compression requires the (missing) zlib和python安装setuptools报错的介绍到此结束,谢谢您的阅读,有关"One or more types required to compile a dynamic expression cannot be found. Are you missing...、Access restriction: The type BASE64Encoder is not accessible due to restrict on required library、An application is attempting to perform an action that requires privileges. Authentication is requir、Apache Shiro 使用 RequiresPermissions with Spring...等更多相关知识的信息可以在本站进行查询。
本文标签: