我需要整齐地下载,但是我总是遇到错误。
起初我尝试使用:
pip install shapely
它不起作用,所以我在互联网上搜索了它,并被告知要在这里下载文件https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely,然后下载了名为Shapely‑1.6.4.post1‑cp37的文件‑cp37m‑win_amd64.whl,因为我的Windows是64位,这是最新版本。我再次尝试,但没有成功。我在这个问题(https://gis.stackexchange.com/questions/62925/why-is-shapely-not-installing-correctly)中发现的内容告诉我可以尝试以下操作:
pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64
它也不起作用,但是错误消息有所不同。
这是我收到的错误消息:
C:\Users\João Pedro>pip install Shapely
Collecting Shapely
Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23
b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\JOOPED~1\AppData\Local\Temp\pip-install-1wjtbq19\Shapely\se
tup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\JOOPED~1\AppData\Local\Temp\pip-install-1wjtbq19\Shapely\sh
apely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "c:\users\joão pedro\appdata\local\programs\python\python37\lib\ctype
s\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Não foi possível encontrar o módulo especificado
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\JOOPED~1\AppData\Local\Temp\pip-install-1wjtbq19\Shapely\
C:\Users\João Pedro>pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64
ERROR: Invalid requirement: 'Shapely-1.6.4.post1-cp37-cp37m-win_amd64'
C:\Users\João Pedro>python -m pip install Downloads\Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl
WARNING: Requirement 'Downloads\\Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl is not a valid wheel filename.
C:\Users\João Pedro>pip install Downloads\Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl
WARNING: Requirement 'Downloads\\Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl is not a valid wheel filename.
我也有geos模块,因为在PyPI页面中,我说您需要正确安装它。
答案 0 :(得分:0)
确保在安装命令中指定滚轮文件if (isset($_FILES['my_file'])) {
$arr = file($_FILES['my_file']['tmp_name'], FILE_IGNORE_NEW_LINE);
// ... do stuff with $arr
}
的完整路径,然后重试。
答案 1 :(得分:0)
请确保为您的Python版本下载正确的轮子,cp37在3.7以上的任何其他Python版本上均无法使用。还要找到安装Python的目标,导航至venv-> scripts并在其中复制所有内容。然后cd到同一位置,然后点按安装该轮子。