Python_环境部署及报错汇总(0)
一、安装Anaconda
Anaconda是一个开源的包、环境管理器,可以用于在同一个机器上安装不同版本的软件包及其依赖,并能够在不同的环境之间切换。
Anaconda包括Conda、Python以及一大堆安装好的工具包,比如:numpy等
1、安装完成后启动

2、修改Anaconda镜像地址
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

3、安装jpype1-手动方式
自动方式安装(pip install jpype1)会报错,选择手动方式; Anaconda已自带wheel不须再安装
下载.whl文件:JPype1-0.6.3-cp37-cp37m-win_amd64.whl
下载路径:https://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype
安装:pip install C:\Users\gaogao\Downloads\JPype1-0.6.3-cp37-cp37m-win_amd64.whl

二、安装PyCharm

1、设置字体及大小
File->Settings

三、报错汇总
1、ModuleNotFoundError: No module named 'jpype'
解决:python 中调用java代码需要安装 jpype1 。
2、ImportError: numpy.core.multiarray failed to import
解决:python 安装numpy。
3、报错:numpy-1.16.1+mkl-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.

解决:python版本位数与whl文件位数要保持一致.(本地python32位换成64位)

4、打包成exe后执行闪退
解决:将.exe文件手动到DOS窗口可查看日志

5、 error: Microsoft Visual C++ 14.0 is required.
Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
解决:安装jpype时报的错,由于c++依赖库不存在,所以在对包进行编译的时候出错,故我们可以去直接下载二进制安装包进行安装。(即自动方式安装)
6、 Could not install packages due to an EnvironmentError: [WinError 5]
权限不足,需要管理员身份运行
拒绝访问。:
'c:\\program files\\python37\\lib\\site-packages\\pip-18.1.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.
解决一:使用C:\Windows\System32 文件夹下面的cmd.exe
解决二:python -m pip install --upgrade pip改成python -m pip install --user --upgrade pip
7、 打包好的exe执行报错:
ImportError: numpy.core.multiarray failed to import

解决方法01,改变控制台的编码格式为utf-8,在控制台中输入 chcp 65001,然后再使用pyinstaller -D xxx.py 打包成功。
解决方法02:源代码中startJVM的顺序调整一下:
app = App(root)
classpath = os.path.join(os.path.abspath('.'), './')
startJVM(getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" %(classpath))
javaClass = JClass('Test')
#问题根因是App()实例初始化在startJVM之后导致的。
解决方法03:将打包好的文件夹先拷贝到其他盘(不要在C盘),再以管理员身份运行
8、No matching distribution found for pyinstaller
Could not find a version that satisfies the requirement pyinstaller (from versions: )
No matching distribution found for pyinstaller
解决:网络慢,可通过镜像下载:
pip install pyinstaller -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
9、Pip install jpype1 报错
building '_jpype' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":

解决:下载visualcppbuildtools_full.exe
10 jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class Test not found
Traceback (most recent call last):
File "
my_test.py", line 57, in <module>File "site-packages\jpype\_
jclass.py", line 73, in JClassjpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class Test not found
[5876] Failed to execute script my_test
Python_环境部署及报错汇总(0)的更多相关文章
- JDK1.8环境下依然报错 Unsupported major.minor version 52.0
JDK1.8环境下依然报错 Unsupported major.minor version 52.0 在配置elasticsearch-rtf全文搜索引擎时,按照Github上项目readme.md来 ...
- Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案
我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...
- Python_爬虫 Scrapy 安装报错一整套处理流程
安装顺序 scrapy 需要的依赖很多.首先需要 twisted 如果没有这个 直接安装 scrapy 会报错 要求你安装一个 vis 14 还是什么的环境,那个东西如果真的要装要 6g 但 ...
- Ambari集成Kerberos报错汇总
Ambari集成Kerberos报错汇总 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看报错的配置信息步骤 1>.点击Test Kerberos Client,查看相 ...
- Ubuntu操作系统编译安装zabbix报错汇总
Ubuntu操作系统编译安装zabbix报错汇总 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.报错提示:"configure: error: MySQL libra ...
- Python2.7在Windows下CMD编码为65001/utf-8时print报错[Errno 0]/[Errno 2]
使用python2.7处理unicode的字符串,环境变量已设置PYTHONIOENCODING为utf-8,cmd编码为utf-8时print unicode字符串会报错[Errno 0]或[Err ...
- selenium报错汇总
selenium报错汇总 报错:[error] Could not connect to Selenium Server. Have you started the Selenium Server y ...
- Tomcat6环境JBPM4.4报错:java.lang.ClassNotFoundException: de.odysseus.el.util.SimpleResolver
Tomcat6环境JBPM4.4报错:java.lang.ClassNotFoundException: de.odysseus.el.util.SimpleResolver 报错信息:
- jmeter Linux环境执行总报错 cannot allocate memory
1.windows环境写好的测试用例,执行没有问题,在Linux环境跑总是报错,提示如下 cannot allocate memory 2.一开始以为是哪块设置有问题,因为脚本里边有设置邮件自动发送, ...
随机推荐
- Huginn及环境搭建
博客搬迁至https://blog.wangjiegulu.com RSS订阅:https://blog.wangjiegulu.com/feed.xml Huginn 及环境搭建 什么是 Hugin ...
- Python 简单入门指北(二)
Python 简单入门指北(二) 2 函数 2.1 函数是一等公民 一等公民指的是 Python 的函数能够动态创建,能赋值给别的变量,能作为参传给函数,也能作为函数的返回值.总而言之,函数和普通变量 ...
- HLS playlist典型示例
[时间:2018-06] [状态:Open] [关键词:流媒体,HLS,m3u8,playlist,variant, alternate] 0 引言 本文主要是对apple官网上的echnical N ...
- [Linux]systemd和sysV
转自:https://www.cnblogs.com/EasonJim/p/7168216.html 在Debian8中systemd和sysVinit同时存在,NTP就是在/etc/init.d/n ...
- 【javascript】定时器组件
'use strict'; module.exports = function() { this.timer = {}; this.config = {}; // 初始化参数 this.init = ...
- springmvc date
数据格式化,从本质上讲属于数据转换的范畴.Spring就是基于数据转换框架植入“格式化”功能的. 在数据转换时我们进行了如下配置: 我们使用的是ConversionServiceFactoryBean ...
- react服务端渲染同构报错Browser history needs a DOM
https://github.com/nozzle/react-static/issues/343 去掉了browserRouter就不报错了,但是又会有其他报错..
- 使用 pt-online-schema-change 实现在线DDL
问题背景 平时进行修改表的结构,更改字段,新增字段,更改字段名称一般都是通过ALTER TABLE 语法进行修改的.对于小表或者并发访问不是很大的情况是OK.但是如果是在线大表,那就很麻烦.由于表数 ...
- fiddler 使用记录
fiddler 工作原理 Fiddler 启动后将自己变成一个代理服务器,这个代理服务器默认监听 127.0.0.1:8888. Filddler 启动后浏览器的代理会被自动更改为 127.0.0.1 ...
- webapi 统一处理时间格式
public class UnixDateTimeConvertor : DateTimeConverterBase { public override object ReadJson(JsonRea ...