2024-06-09 13:37:28 发布
网友
我正在开发一个CentOS 6.5,它有Python2.6.6,我还安装了Python2.7.5
问题是我想导入qgis并使用Python2.7.5。在
如果我写
from qgis.core import *
没有问题,但是当我尝试使用python2.7时,输入scl enable python27 bash和impro,它返回的moudle
有什么帮助吗?我尝试在PYTHONPATH中添加qgis的安装路径,但是没有成功
如果需要在同一台计算机上支持多个Python和多个应用程序,请使用Python虚拟环境:
https://packaging.python.org/en/latest/installing/#creating-virtual-environments
创建虚拟环境并在其中安装qgic的示例:
virtualenv -p python2.7 venv # Create Python installation in venv folder source venv/bin/activate # Activate this environment pip install qgis # Replace this with installation instructions from qgis package
如果需要在同一台计算机上支持多个Python和多个应用程序,请使用Python虚拟环境:
https://packaging.python.org/en/latest/installing/#creating-virtual-environments
创建虚拟环境并在其中安装qgic的示例:
相关问题 更多 >
编程相关推荐