简体   繁体   English

pip install arcade 不断给出“找不到模块‘geos_c.dll’(或其依赖项之一)。geos.dll 和 geos_c.dll 无法找到

[英]pip install arcade keeps giving "Could not find module 'geos_c.dll' (or one of it dependencies). geos.dll and geos_c.dll unfindable

Long post for one error I keep getting:我不断收到一个错误的长篇文章:

PC, Windows 10, I have used PyCharm, VS Code, Powershell for pip installations, virtual environments as well as normal. PC,Windows 10,我用过PyCharm,VS Code,Powershell pip安装,虚拟环境也正常。

I am trying to get the arcade library installed, so I can get to building a platform type game with a friend.我正在尝试安装街机库,这样我就可以和朋友一起构建平台类型的游戏了。 Having done research on what libraries to use, we came across Arcade, looking perfect for our idea for the platformer.在研究了要使用的库之后,我们发现了 Arcade,它看起来非常适合我们的平台游戏想法。

https://api.arcade.academy/en/latest/examples/platform_tutorial/step_01.html https://api.arcade.academy/en/latest/examples/platform_tutorial/step_01.html

And

https://api.arcade.academy/en/latest/install/windows.html https://api.arcade.academy/en/latest/install/windows.html

Now here's the crux.现在是症结所在。 I have followed all the steps, have tried installing it in various ways (virtual environments as well), but I keep getting the same error code (please continue reading after the error codes, as I've tried various solutions already):我已按照所有步骤进行操作,尝试以各种方式安装它(也包括虚拟环境),但我一直收到相同的错误代码(请在错误代码后继续阅读,因为我已经尝试过各种解决方案):

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.

Having already tried to research this (and finding many questions for the shapely lib, as that's where it is coming from by the looks of it) and many, many different solutions, I keep still getting the same error.已经尝试对此进行研究(并为 shapely lib 找到许多问题,因为它的外观就是它的来源)和许多许多不同的解决方案,但我仍然遇到相同的错误。

I have tried installing shapely, but each line gives me the following error, all the way to version 1.5.9.tar.gz我已经尝试安装 shapely,但每一行都给我以下错误,一直到版本 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:

Solutions tried:解决方案尝试:

  • I have gone to the geos website, downloaded and installed OSGeo4W.我已经访问了 geos 网站,下载并安装了 OSGeo4W。 This file is installed and exists on my C drive and has both dll files in it.此文件已安装并存在于我的 C 驱动器上,其中包含两个 dll 文件。
  • I've added several paths as well, directing to various places these dll files can now be found in as they are on my PC.我也添加了几个路径,指向这些 dll 文件现在可以在我的 PC 上找到的不同位置。
  • We have even looked in the geos.py file to figure out what it does and where it goes wrong.我们甚至查看了 geos.py 文件以弄清楚它做了什么以及哪里出错了。 The code will error out and say it cannot find geos.dll in a folder where the actual file is.该代码将出错并说它无法在实际文件所在的文件夹中找到 geos.dll。

So now I'm stuck, my friend and I have exhausted all possible solutions he and I could come up with or find to try and resolve it, and I am unable to find a way to code using arcade due to this geos.dll and geos_c.dll file errors.所以现在我被困住了,我和我的朋友已经用尽了他和我可以想出或找到尝试解决它的所有可能的解决方案,而且由于这个 geos.dll 和我无法找到使用街机编码的方法geos_c.dll 文件错误。

As it turns out, the Arcade lib documentation mentions using Python 3.7 on Windows 10, whereas my Miniconda was using Python 3.9 and my VS Code Python 3.10.事实证明,Arcade lib 文档提到在 Windows 10 上使用 Python 3.7,而我的 Miniconda 使用的是 Python 3.9 和我的 VS Code Python 3.10。

Using the Anaconda Prompt to install Python 3.7, then allowed me to install both arcade and shapely without any problems.使用 Anaconda Prompt 安装 Python 3.7,然后让我可以毫无问题地安装 Arcade 和 shapely。

Shapely never upgraded to work on Windows with Python 3.10. Shapely 从未升级到 Windows 和 Python 3.10。 The current versions of Arcade make Shapely optional and fall back to non-shapely Python code. Arcade 的当前版本使 Shapely 成为可选的,并退回到非 shapely Python 代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM