简体   繁体   中英

Python interpreter, virtual environments and pycharm

Platform Windows. IDE PyCharm CE.

I have a script that uses module ArcPy from ESRI. This module has its own Python 2.6. I have to import a module that uses dictionary comprehensions not supported by 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)? Can this cause problems later to arc map?

You can upgrade your ArcGis Python 2.6 release to 2.7. If you need Python 3, it won't work, because arcpy works only in Python 2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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