Python 通过 conda 或 pip 找不到安装 shapefile / shapelib

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22891332/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 01:54:09  来源:igfitidea点击:

Installing shapefile / shapelib not found via conda or pip

pythonmatplotlibgisipythonanaconda

提问by James Salamon

I am trying to read shapefiles to view suburbs in a city following this tutorialusing windows 8, Anaconda and iPython.

我正在尝试使用 Windows 8、Anaconda 和 iPython阅读 shapefile 以查看本教程之后的城市郊区。

I tried "conda install shapefile" and "pip install shapefile" in command prompt, both returning "Error: No packages found matching: shapefile".

我在命令提示符下尝试了“conda install shapefile”和“pip install shapefile”,两者都返回“错误:找不到匹配的包:shapefile”。

Besides that I tried adding it manually following these links [1]How to import a module given the full path?[2]Import python module NOT on path. However I am getting permission errors which suggests I am not importing them correctly anyway.

除此之外,我尝试按照这些链接手动添加它 [1]如何在给定完整路径的情况下导入模块?[2]导入 python 模块不在路径上。但是,我收到了权限错误,这表明我没有正确导入它们。

Any suggestions on how to proceed or best practices are appreciated.

任何关于如何进行或最佳实践的建议表示赞赏。

采纳答案by Retozi

try

尝试

pip install pyshp

in your cmd.

在你的 cmd 中。

that is the name of you library as far as I can see, see https://pypi.python.org/pypi/pyshp

据我所知,这是您图书馆的名称,请参阅https://pypi.python.org/pypi/pyshp

conda only works for these http://docs.continuum.io/anaconda/pkgs.htmlpackages.

conda 仅适用于这些http://docs.continuum.io/anaconda/pkgs.html包。

For the ones not in the list you need to use pip install. It can be confusing as the name of the library on pypi (this is where pip goes to download it) is often, but not always the same as the import name, so if conda and pip don't work, first try to google to make 100% sure that your library is not on pypi, because most respectable libraries are...

对于不在列表中的那些,您需要使用 pip install。它可能会令人困惑,因为 pypi 上的库名称(这是 pip 下载它的地方)通常但并不总是与导入名称相同,所以如果 conda 和 pip 不起作用,首先尝试谷歌搜索100% 确定您的库不在 pypi 上,因为大多数受人尊敬的库是...