我不断收到一个错误的长帖:
PC,Windows 10,我使用 PyCharm、VS Code、Powershell 进行 pip 安装、虚拟环境以及普通环境。
我正在尝试安装街机库,这样我就可以和朋友一起构建平台类型的游戏。在对要使用的库进行了研究之后,我们遇到了 Arcade,它看起来非常适合我们的平台游戏想法。
https://api.arcade.academy/en/latest/examples/platform_tutorial/step_01.html
和
https://api.arcade.academy/en/latest/install/windows.html
现在这是症结所在。我已按照所有步骤操作,并尝试以各种方式安装它(虚拟环境也是如此),但我一直收到相同的错误代码(请在错误代码之后继续阅读,因为我已经尝试了各种解决方案):
PS C:\Users\Grace\AppData\Local\Programs\Python\Python310> pip install arcade
Collecting arcade
Using cached arcade-2.6.3-py3-none-any.whl (39.2 MB)
Collecting shapely==1.7.1
Using cached Shapely-1.7.1.tar.gz (383 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Grace\AppData\Local\Programs\Python\Python310\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Grace\\AppData\\Local\\Temp\\pip-install-labiwb90\\shapely_c43a03848a5e4619a6d0372e22fc4a7c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Grace\\AppData\\Local\\Temp\\pip-install-labiwb90\\shapely_c43a03848a5e4619a6d0372e22fc4a7c\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Grace\AppData\Local\Temp\pip-pip-egg-info-0b2ppic9'
cwd: C:\Users\Grace\AppData\Local\Temp\pip-install-labiwb90\shapely_c43a03848a5e4619a6d0372e22fc4a7c\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Grace\AppData\Local\Temp\pip-install-labiwb90\shapely_c43a03848a5e4619a6d0372e22fc4a7c\setup.py", line 85, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Grace\AppData\Local\Temp\pip-install-labiwb90\shapely_c43a03848a5e4619a6d0372e22fc4a7c\shapely\_buildcfg.py", line 205, in <module>
lgeos = CDLL("geos_c.dll")
File "C:\Users\Grace\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/42/f3/0e1bc2c4f15e05e30c6b99322b9ddaa2babb3f43bc7df2698efdc1553439/Shapely-1.7.1.tar.gz#sha256=1641724c1055459a7e2b8bbe47ba25bdc89554582e62aec23cb3f3ca25f9b129 (from https://pypi.org/simple/shapely/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
已经尝试对此进行研究(并为形状优美的库找到了许多问题,因为从外观上看,这就是它的来源)和许多不同的解决方案,但我仍然遇到同样的错误。
我尝试过安装匀称,但每一行都给我以下错误,一直到版本 1.5.9.tar.gz
PS E:\GAME\project> pip install shapely
Collecting shapely
Using cached Shapely-1.8.0.tar.gz (278 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'e:\my virtual env\this one\scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Grace\\AppData\\Local\\Temp\\p
ip-install-sly8ntwk\\shapely_e4ed214432664ba8b60621c78133751b\\setup.py'"'"'; __file__='"'"'C:\\Users\\Grace\\AppData\\Local\\Temp\\pip-install-sly8ntwk\\shapely_e4ed
214432664ba8b60621c78133751b\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools impo
rt setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Grace\AppData\Local\Temp\pip-pip-egg-info-a5sb9s6p'
cwd: C:\Users\Grace\AppData\Local\Temp\pip-install-sly8ntwk\shapely_e4ed214432664ba8b60621c78133751b\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Grace\AppData\Local\Temp\pip-install-sly8ntwk\shapely_e4ed214432664ba8b60621c78133751b\setup.py", line 74, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Grace\AppData\Local\Temp\pip-install-sly8ntwk\shapely_e4ed214432664ba8b60621c78133751b\shapely\_buildcfg.py", line 204, in <module>
lgeos = CDLL("geos_c.dll")
File "C:\Users\Grace\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1c/0c/454c80f71bd5ece52fb06d2905bf956b9122f4be539d5ae5df4b10dd3e14/Shapely-1.8.0.tar.gz#sha256=f5307ee14ba41
99f8bbcf6532ca33064661c1433960c432c84f0daa73b47ef9c (from https://pypi.org/simple/shapely/) (requires-python:>=3.6). Command errored out with exit status 1: python setu
p.py egg_info Check the logs for full command output.
Using cached Shapely-1.7.1.tar.gz (383 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
尝试的解决方案:
- 我去了geos网站,下载并安装了OSGeo4W。该文件已安装并存在于我的 C 驱动器上,其中包含两个 dll 文件。
- 我还添加了几个路径,指向现在可以在我的 PC 上找到这些 dll 文件的各个位置。
- 我们甚至查看了 geos.py 文件以弄清楚它做了什么以及哪里出了问题。代码会出错,并说它在实际文件所在的文件夹中找不到 geos.dll。
所以现在我被困住了,我和我的朋友已经用尽了所有可能的解决方案,他和我可以想出或找到尝试解决它,由于这个 geos.dll 和我无法找到使用街机编码的方法和geos_c.dll 文件错误。