编辑:
问题:
我正在遇到安装安纳康达所说的内容与使用Python实际导入的内容之间的差异。
我已经安装在虚拟Anaconda环境(GIS)地球座,GDAL,PANDAS等中。确实,所有这些图书馆都出现在列表中。
然后,我打开Visual Studio并将环境设置为(GIS)。在脚本中,我运行导入pandas
,导入geopandas
和从Osgeo导入GDAL
。目前,剧本挂在大熊猫上。 modulenotfounderror:没有名为“ pandas”
的模块。如果我首先尝试其他人,则会发生同样的问题。
其他尝试:
我也尝试从终端(Anaconda提示之外)采取PIP方法。
1。从 - > 命令提示符仍然无法识别GDAL。 - > 尝试将路径手动设置为GDAL文件夹的位置。 - > 仍然未被认可。
2。使用了OSGEO4W设置中的“自定义陶载”,找到了文件夹,手动设置到文件夹(确保先删除先前设置的路径)。结果:与上述尝试相同。
3。尝试从 gis内部支持网站。没有结果。我确实注意到,这个网站没有包含与我的Python时代(3.10.3)的MSVC编号的GDAL版本,这使我怀疑这可能是我所有尝试的问题吗?我不想冒险降级Python,因为每次更改版本时,我似乎都会引起更多问题。
如果有人能够解决这个问题,我会感谢我感谢。我花了更多时间尝试配置我的python库和口译员,而不是在这一点上编写脚本。
此外,如果对这个问题的更好名称提出了任何建议,则可能会更容易找到它。
Edited:
Issue:
I am experiencing a discrepancy between what Anaconda says is installed and what can actually be imported using Python.
I have installed in a virtual anaconda environment (gis) geopandas, gdal, pandas, etc.. Then I confirmed their installation by running conda list
. Indeed all these libraries showed up in the list.
I then open Visual Studio and set the environment to (gis). Within the script I run import pandas
, import geopandas
, and from osgeo import gdal
. Currently, the script get hung up on pandas. ModuleNotFoundError: No module named 'pandas'
. If I try the others first, the same problem occurs.
Other Attempts:
I have also tried taking the pip approach from the terminal (outside of anaconda prompt).
1. Dowloading gdal from Christoph Gohlke's site "GDAL‑3.4.2‑pp38‑pypy38_pp73‑win_amd64.whl". -> Command prompt still didn't recognize gdal. -> Tried setting a path manually to the location of the gdal folder. -> Still not recognized.
2. Used a "custom dowload" from OSGeo4W setup, found the folder, manual set path to folder (made sure to delete previously set paths first). Result: same as above attempts.
3. Tried download from GIS internals support site. No result. I did notice though that this site did not include a version of gdal with an MSVC number that matched that of my verion of python (3.10.3) This made me suspect possibly that this was the problem for all my attempts? I did not want to risk downgrading python though as every time I change the version I seem to cause more issues.
I would reeeeeaaaaally appreciate if someone could help e through this problem. I have spent more time trying to configure my Python libraries and interpreters than writing scripts at this point.
Additionally, if there are any suggestions as to better names for this question that would likely result in it being more easily found.
发布评论
评论(1)
最后,我沿着Python虚拟环境路线,发现此非常有用的链接这对我有用。
In the end I took the python virtual environment route and found this very helpfull link which did the trick for me.