5

So I tried to install a package from PyPI with the following command:

sudo pip3 install switcheo

But it fails to install the package in the end.

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/

This is the full output in the terminal after running the pip install line. I found some solutions for linux, but there are not a lot of posts here for mac users.

5
  • Please always post the full error message. Commented Feb 10, 2019 at 14:25
  • Have you tried installing inside a virtual environment? Commented Feb 10, 2019 at 14:34
  • Okay I updated the post with the rest of the error messages, But I left out the rest of the terminal output because it was too much. Commented Feb 10, 2019 at 14:43
  • Basically, the file openssl/aes.h isn't present in your system, which means you should install a library called OpenSSL Commented Feb 10, 2019 at 15:04
  • The error is fatal error: 'openssl/aes.h' file not found. Similar to openssl-aes-h-file-not-found-on-mac. Commented Feb 10, 2019 at 15:05

3 Answers 3

15

I dealt with this problem for a while while trying to install another library that relies on openssl in a MacOS virtual env.

Mac has deprecated openssl in favor of their own SSL. So what you need to do is:

    brew install openssl

or if it is already installed,

    brew reinstall openssl

Now you need to to change the LD and CPP Flags. Refer to the openssl reinstall dialog. Should tell you where the commands!

openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:

    echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:

    export LDFLAGS="-L/usr/local/opt/openssl/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:

    export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
Sign up to request clarification or add additional context in comments.

2 Comments

Awesome thanks for the reply, I had made a separate post with a similar question and still no concrete solution. This seems to do the trick.
Great! Took me a while to figure this out as well.
0

You're either missing the OpenSSL package, or your system can't find where it is on your system. Try brew install openssl.

A more detailed answer openssl/aes.h' file not found on Mac

Comments

0

after spending hours, i successfullly installed.

  • If you are using mac and if you are using anaconda

  • please open python terminal from anaconda

  • then paste the following link and click enter.

  • conda install -c conda-forge/label/gcc7 wordcloud

  • if you need more clarity please visit following link https://anaconda.org/conda-forge/wordcloud

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.