我想在 Conda 环境中的 MacBook 上安装 Clupy。 它只给出了 Linux 系统的 pip3 指令。
我尝试做的是
conda activate spyder-geo
和
pip install cloupy
或
pip3 install cloupy
但我收到以下错误
(spyder-geo) andreacecilia@MacBook-Pro-di-Andrea ~ % pip install cloupy
Collecting cloupy
Using cached cloupy-1.1.0-py3-none-any.whl (1.0 MB)
Collecting matplotlib<=3.5.1,>=3.4.3
Downloading matplotlib-3.5.1-cp39-cp39-macosx_11_0_arm64.whl (7.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.2/7.2 MB 8.8 MB/s eta 0:00:00
Collecting pandas<=1.3.5,>=1.3.3
Using cached pandas-1.3.5.tar.gz (4.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting beautifulsoup4<=4.10.0,>=4.9.3
Using cached beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting scipy<=1.7.3,>=1.7.2
Using cached scipy-1.7.3-1-cp39-cp39-macosx_12_0_arm64.whl (27.0 MB)
Collecting Pillow<=9.0.0,>=8.4.0
Using cached Pillow-9.0.0-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB)
Collecting requests<=2.27.1,>=2.26.0
Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Collecting numpy<=1.22.1,>=1.21.4
Using cached numpy-1.22.1-cp39-cp39-macosx_11_0_arm64.whl (12.8 MB)
Requirement already satisfied: pyshp==2.1.3 in ./miniconda3/envs/spyder-geo/lib/python3.9/site-packages (from cloupy) (2.1.3)
Requirement already satisfied: cycler==0.11.0 in ./miniconda3/envs/spyder-geo/lib/python3.9/site-packages (from cloupy) (0.11.0)
Collecting pyproj<=3.3.0,>=3.2.1
Using cached pyproj-3.3.0.tar.gz (217 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
<string>:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
Traceback (most recent call last):
File "/Users/andreacecilia/miniconda3/envs/spyder-geo/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/Users/andreacecilia/miniconda3/envs/spyder-geo/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/andreacecilia/miniconda3/envs/spyder-geo/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/j8/z9z9dhys2sl71vnvnsbgn0780000gn/T/pip-build-env-36cst6x7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/j8/z9z9dhys2sl71vnvnsbgn0780000gn/T/pip-build-env-36cst6x7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/private/var/folders/j8/z9z9dhys2sl71vnvnsbgn0780000gn/T/pip-build-env-36cst6x7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/private/var/folders/j8/z9z9dhys2sl71vnvnsbgn0780000gn/T/pip-build-env-36cst6x7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 232, in <module>
File "<string>", line 160, in get_extension_modules
File "<string>", line 23, in get_proj_version
File "/Users/andreacecilia/miniconda3/envs/spyder-geo/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Users/andreacecilia/miniconda3/envs/spyder-geo/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '/Users/andreacecilia/miniconda3/envs/spyder-geo/bin/proj' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
也许是因为在公寓环境中使用 pip 是不正确的,但我不知道还能做什么。我为 Spyder 使用这个环境。
对于 PyPI 上已有的纯 Python 包,理想的解决方案是使用 grayskull
将其添加到 Conda Forge。这样,不仅你可以通过 Conda 安装它,以后的每个人都可以! 🤩 我已经添加了
PR来添加它。对于此类简单的包裹,周转时间通常在 48 小时内。一旦完成,那么人们就可以做到:
conda install -c conda-forge cloupy
不过,请注意,此包的依赖项版本相当窄(下限 + 上限),因此最好为此创建一个新环境:
conda create -n cloupy -c conda-forge cloupy
staged-recipes
提交内容中直接标记我(GH:@mfansler
)。我可以帮助/审查 Python、C++ 和 R 食谱。