因此,我尝试使用以下命令从PyPI安装软件包:
sudo pip3 install switcheo
但是最后无法安装该软件包。
Error checking for conflicts.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2584, in version
return self._version
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 503, in _warn_about_conflicts
package_set, _dep_info = check_install_conflicts(to_install)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
package_set, _ = create_package_set_from_installed()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
package_set[name] = PackageDetails(dist.version, dist.requires())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2589, in version
raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or METADATA file", Unknown [unknown version] (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages))
Installing collected packages: scrypt, neocore, switcheo
scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>
^~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-b6w97vc0/scrypt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-qvammwag/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-b6w97vc0/scrypt/
这是运行pip安装线后终端中的完整输出。 我找到了一些针对linux的解决方案,但是这里没有很多针对mac用户的帖子。
答案 0 :(得分:2)
在尝试安装另一个依赖于MacOS虚拟环境中的openssl的库时,我处理了一段时间。
Mac已弃用openssl,转而使用自己的SSL。因此,您需要做的是:
brew install openssl
或者如果已经安装,
brew reinstall openssl
现在,您需要更改LD和CPP标志。请参考openssl重新安装对话框。应该告诉你命令在哪里!
openssl仅适用于小桶,这意味着它没有符号链接到/ usr / local, 因为苹果已经弃用OpenSSL,而是使用自己的TLS和加密库。
如果您需要先在运行的PATH中打开openssl:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
要让编译器找到openssl,您可能需要设置:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
要让pkg-config查找openssl,您可能需要设置:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
答案 1 :(得分:0)
您要么缺少OpenSSL软件包,要么您的系统找不到它在系统上的位置。尝试brew install openssl
。
答案 2 :(得分:0)
花了几个小时后,我成功安装。
如果您使用的是 mac 并且您使用的是 anaconda
请从anaconda打开python终端
然后粘贴以下链接并点击进入。
conda install -c conda-forge/label/gcc7 wordcloud
如果您需要更清晰的信息,请访问以下链接 https://anaconda.org/conda-forge/wordcloud