Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upgrade coursera-dl: command 'x86_64-linux-gnu-gcc' failed with exit status 1 #586

Closed
adamvoss opened this issue Feb 8, 2017 · 4 comments

Comments

@adamvoss
Copy link

adamvoss commented Feb 8, 2017

Subject of the issue

sudo pip3 install --upgrade coursera-dl

Running the above command to update coursera-dl fails (coursera-dl is already installed and working). I recognize that the installation as root is not recommended, but I was already down that path before I read the instructions and coursera-dl has worked fine.

I am sure there is probably a simple dependency or configuration fix here, but since this issue was not yet appearing in the issue tracker or README.

Your environment

  • Operating System (name/version): Linux Mint 18.1 Cinnamon 64-bit
  • Python version: Python 3.5.2
  • coursera-dl version: 0.8.0
  • pip version: pip 9.0.1

Steps to reproduce

I execute the following in my environment.

sudo pip3 install --upgrade coursera-dl

Expected behaviour

Coursera-dl updates

Actual behaviour

The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: coursera-dl in /usr/local/lib/python3.5/dist-packages
Requirement already up-to-date: beautifulsoup4>=4.1.3 in /usr/local/lib/python3.5/dist-packages (from coursera-dl)
Requirement already up-to-date: requests>=2.10.0 in /usr/local/lib/python3.5/dist-packages (from coursera-dl)
Requirement already up-to-date: six>=1.5.0 in /usr/lib/python3/dist-packages (from coursera-dl)
Requirement already up-to-date: urllib3>=1.10 in /usr/local/lib/python3.5/dist-packages (from coursera-dl)
Requirement already up-to-date: pyasn1>=0.1.7 in /usr/local/lib/python3.5/dist-packages (from coursera-dl)
Requirement already up-to-date: keyring>=4.0 in /usr/local/lib/python3.5/dist-packages (from coursera-dl)
Requirement already up-to-date: secretstorage; sys_platform == "linux2" or sys_platform == "linux" in /usr/local/lib/python3.5/dist-packages (from keyring>=4.0->coursera-dl)
Collecting cryptography (from secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
  Downloading cryptography-1.7.2.tar.gz (420kB)
    100% |████████████████████████████████| 430kB 1.3MB/s 
Requirement already up-to-date: idna>=2.0 in /usr/local/lib/python3.5/dist-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: setuptools>=11.3 in /usr/local/lib/python3.5/dist-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: cffi>=1.4.1 in /usr/local/lib/python3.5/dist-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python3.5/dist-packages (from setuptools>=11.3->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python3.5/dist-packages (from setuptools>=11.3->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: pycparser in /usr/local/lib/python3.5/dist-packages (from cffi>=1.4.1->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Requirement already up-to-date: pyparsing in /usr/local/lib/python3.5/dist-packages (from packaging>=16.8->setuptools>=11.3->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=4.0->coursera-dl)
Installing collected packages: cryptography
  Found existing installation: cryptography 1.2.3
    Uninstalling cryptography-1.2.3:
      Successfully uninstalled cryptography-1.2.3
  Running setup.py install for cryptography ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5857maa3/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bbrejiam-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/__init__.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/utils.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/__about__.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/fernet.py -> build/lib.linux-x86_64-3.5/cryptography
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat
    copying src/cryptography/hazmat/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat
    creating build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/name.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/oid.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/extensions.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/general_name.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    copying src/cryptography/x509/base.py -> build/lib.linux-x86_64-3.5/cryptography/x509
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/serialization.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/multibackend.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings
    copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/asymmetric
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/twofactor
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/kdf
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/ciphers
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/interfaces
    copying src/cryptography/hazmat/primitives/interfaces/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/primitives/interfaces
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/ciphers.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/backend.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/hashes.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/hmac.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/commoncrypto
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/backends/openssl
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/commoncrypto
    copying src/cryptography/hazmat/bindings/commoncrypto/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/commoncrypto
    copying src/cryptography/hazmat/bindings/commoncrypto/binding.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/commoncrypto
    creating build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-x86_64-3.5/cryptography/hazmat/bindings/openssl
    running egg_info
    writing requirements to src/cryptography.egg-info/requires.txt
    writing src/cryptography.egg-info/PKG-INFO
    writing dependency_links to src/cryptography.egg-info/dependency_links.txt
    writing top-level names to src/cryptography.egg-info/top_level.txt
    writing entry points to src/cryptography.egg-info/entry_points.txt
    reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-3.5/_padding.c'
    creating build/temp.linux-x86_64-3.5
    generating cffi module 'build/temp.linux-x86_64-3.5/_constant_time.c'
    generating cffi module 'build/temp.linux-x86_64-3.5/_openssl.c'
    building '_openssl' extension
    creating build/temp.linux-x86_64-3.5/build
    creating build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o
    build/temp.linux-x86_64-3.5/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of cryptography
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5857maa3/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bbrejiam-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5857maa3/cryptography/
@balta2ar
Copy link
Member

balta2ar commented Feb 8, 2017

Try this: okfn/piati#65 (comment)
ycm-core/YouCompleteMe#2219 (comment)

I'm not sure what's the package manager in Mint, so adapt the command and the package name to your distribution, but you get the idea.

@adamvoss
Copy link
Author

adamvoss commented Feb 8, 2017

Mint is Ubuntu-based. I gave that a shot, but I seem to already have that package. Probably from this step in the README, because I know I encountered that issue the first time I installed coursera-dl.

sudo apt-get install python-dev

python-dev is already the newest version (2.7.11-1).

@balta2ar
Copy link
Member

balta2ar commented Feb 8, 2017

Judging from the logs, you seem to have installed python-dev for python2, but at the same time you're installing coursera-dl for python3. Install python-dev for python3.

@adamvoss
Copy link
Author

adamvoss commented Feb 8, 2017

*face palm* figured it would be something simple.

sudo apt-get install python3-dev

sudo pip3 install --upgrade coursera-dl

Success. Thanks!

@adamvoss adamvoss closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants