搭建pycharm集成开发环境遇到的问题

      由于项目的需要,在win7下搭建pycharm + pyqt5 + python开发环境,搭建方法和过程可参考这位仁兄:

http://blog.csdn.net/justheretobe/article/details/50492094


搭建完毕后遇到2个问题:

一、搭建完毕后debug时报如下错误:

ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\pydevd.py", line 2411, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\pydevd.py", line 1802, in run
    launch(file, globals, locals)  # execute the script
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:/MyPython/app_src/community_bank.py", line 10, in <module>
    from main_win import MainWin
  File "E:/MyPython/app_src\main_win.py", line 5, in <module>
    import cv2, numpy, time, os
ImportError: numpy.core.multiarray failed to import

Process finished with exit code 1


折腾好久才找到解决办法:

1.启动命令行进入Python安装目录下的Scripts目录下

2.执行命令:

pip install -U numpy 注意-U一定是大写的

如这条执行失败看看是否有类似如下提示:

You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

那么就需要执行命令:

python -m pip install --upgrade pip

成功后再执行pip install -U numpy


二.debug时报如下错误:

Connected to pydev debugger (build 143.2371)
Traceback (most recent call last):
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\pydevd.py", line 2411, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\pydevd.py", line 1802, in run
    launch(file, globals, locals)  # execute the script
  File "D:\JetBrains\PyCharm 5.0.6\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:/MyPython/app_src/community_bank.py", line 10, in <module>
    from main_win import MainWin
  File "E:/MyPython/app_src\main_win.py", line 11, in <module>
    from data_exporter import DataExporter
  File "E:/MyPython/app_src\data_exporter.py", line 6, in <module>
    from excel_helper import ExcelHelper
  File "E:/MyPython/app_src\excel_helper.py", line 4, in <module>
    import xlsxwriter
ImportError: No module named 'xlsxwriter'
Traceback (most recent call last):
Traceback (most recent call last):

解决办法:
执行如下命令:
pip install xlxwriter


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PyCharm 是一款强大的 Python 集成开发环境(IDE),它支持多种操作系统,包括 Windows、macOS 和 Linux。下面是使用 PyCharm 搭建 Python 开发环境的基本步骤: 1. **下载安装**: 访问官网 <https://www.jetbrains.com/pycharm/> 下载适合你操作系统的最新版本。选择 "Community" 版本(免费)或 "Professional" 版本(付费)。 2. **运行安装程序**: 双击下载的安装包,按照向导进行安装。确保在安装过程中勾选 "Add JetBrains Platform to PATH" 选项,这样可以在命令行中直接访问 PyCharm。 3. **配置Python环境**: 安装完成后,打开 PyCharm。首次运行可能会提示你设置 Python 环境。点击 "Configure" > "Project Interpreter",可以选择系统内置的 Python 或者指定你本地已安装的 Python 版本。 4. **新建项目**: 在主界面点击 "Create New Project",选择 "Python" 作为项目类型,选择合适的模板(如 "Empty" 或 "From Existing Sources"),然后指定项目的保存位置。 5. **导入库和设置**: 如果项目需要特定库,可以在 "File" > "Settings" > "Project: Your Project Name" > "Project Interpreter" 中添加。此外,你可以设置代码风格、调试器、VCS(版本控制系统)等偏好项。 6. **环境配置验证**: 创建一个新的 Python 文件,尝试运行一些基本的 Python 代码,检查是否能正常编译和运行。如果遇到问题,可能需要检查环境配置或安装缺失的依赖。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值