简体   繁体   English

Python解释器,虚拟环境和pycharm

[英]Python interpreter, virtual environments and pycharm

Platform Windows. 平台Windows。 IDE PyCharm CE. IDE PyCharm CE。

I have a script that uses module ArcPy from ESRI. 我有一个脚本,该脚本使用来自ESRI的ArcPy模块。 This module has its own Python 2.6. 该模块具有自己的Python 2.6。 I have to import a module that uses dictionary comprehensions not supported by Python 2.6. 我必须导入使用Python 2.6不支持的字典理解的模块。

How do I work around this without rewriting the code to avoiding list comprehensions? 如何解决此问题而无需重写代码来避免列表推导?

Other questions: 其他问题:

  • What should be the correct pattern for project creation and interpreter maintenance? 项目创建和口译员维护的正确模式应该是什么? Should I always use virtual dedicated envs for each project importing any needed modules and keep isolation for each? 我应该为导入每个所需模块的每个项目始终使用虚拟专用环境,并为每个模块保持隔离吗?

  • Is it correct to import the extra needed packages for my projects to the ArcPy python installation Python 2.6.5 (C:/Python26/ArcGIS10.0/python.exe)? 将项目所需的额外软件包导入ArcPy python安装Python 2.6.5(C:/Python26/ArcGIS10.0/python.exe)是否正确? Can this cause problems later to arc map? 以后在弧形地图上会引起问题吗?

You can upgrade your ArcGis Python 2.6 release to 2.7. 您可以将ArcGis Python 2.6版本升级到2.7。 If you need Python 3, it won't work, because arcpy works only in Python 2. 如果需要Python 3,它将无法正常工作,因为arcpy仅在Python 2中有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM