Receiving an error during pip pycuda installation on ubuntu as follows:
command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects
I solved the problem by doing:
For Python 2.x use:
sudo apt-get install python-dev
For Python 2.7 use:
sudo apt-get install libffi-dev
For Python 3.x use:
sudo apt-get install python3-dev
or for a specific version of Python 3, replace x with the minor version in
sudo apt-get install python3.x-dev
I get an error when pip builds wheels for the cryptography package.
Error:
LINK : fatal error LNK1181: cannot open input file 'libssl.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
I have already installed OpenSSL and set the environment variables as suggested in this post yet the problem persists. My setup details:
System - Windows 10
Python - 3.8
Pip - 19.3.1
In my case (windows 10 + conda) updating pip fixed the problem:
python -m pip install --upgrade pip
Setting cryptography to version 2.8 in requirements.txt fixed the issue.
TLDR;
Try using cryptography==3.1.1
Details:
This happened on Python 3.9.0 on Windows 10 PC.
I had the following in requirements.txt
cryptography==2.8
I removed the version and kept only cryptography in requirements.txt file like below
cryptography
Saved the requirements.txt and then I ran
pip install -r requirements.txt
It installed successfully.
Then I freeze the requirements.txt by running the following command
pip freeze > requirements.txt
Then the requirements.txt got updated with cryptography==3.1.1
Had also this issue. If you're using alpine, make sure that all dependencies for cryptography are installed.
In my case the cargo package was missing and causing the issue.
sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo
https://cryptography.io/en/latest/installation.html#building-cryptography-on-linux
Ran into this issue, and the solution is actually in the message when pip attempts to install openssl before cryptography:
generating cffi module 'build/temp.linux-x86_64-3.7/_openssl.c'
running build_rust
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation.html#rust
5) If you are experiencing issues with Rust for *this release only* you may
set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
=============================DEBUG ASSISTANCE=============================
Simply running the pip update command appeared to work for me:
pip install -U pip
Which updated pip from version 18.0 to version 21.0.1
I faced this issue on macOS Monterey (version 12.2.1) Apple M1 Pro. I followed Cryptography installation documentation and it helped me resolve the issue.
brew install openssl#1.1 rust
env CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 LDFLAGS="$(brew --prefix openssl#1.1)/lib/libssl.a $(brew --prefix openssl#1.1)/lib/libcrypto.a" CFLAGS="-I$(brew --prefix openssl#1.1)/include" pip3 install cryptography
You can use the lastest version with
python3 -m pip install --no-use-pep517 cryptography
worked for me with ubuntu:18.04 on arm32v7
(instead as suggested by the error message install the full rust compiler and build-essentials, or upgrading pip (what had no effect on ubuntu:18.04 on my armbian))
pip install --upgrade pip
Try to upgrade pip of your environment working fine for me.
I got this error trying to install Scrapy with Python 3.8.1 on Windows 10, but its solved installing the last version of pip (19.3.1 in my case) and all works using pip in this way:
python -m pip install scrapy --user
I have faced same issue and tried to install openssl with mentioned step but still was not able to proceed for windows 10. Later I upgraded pip to latest version and tried again and it worked without any issue.
I would recommend to upgrade pip to latest version and give a try before proceeding for installing openssl
I had the same issue. pip3 version was 19.* after upgrade it works
sudo -H pip3 install --upgrade pip
You can try to install cryptography==3.1.1 package instead of cryptography 35 version.
pip install cryptography==3.1.1
If still you are facing challenges in cryptography package integration.
You can resolve that by the following steps.
python -m pip install --upgrade pip
sudo pip install -U pip setuptools
I had this problem and i just installed rust and problem fixed for me
You can install end version of cryptography after installing rust programming languege(dont try pip install rust, its not python package)
https://www.rust-lang.org/tools/install
Just updating pip
python -m pip install --upgrade pip
I did not install the latest version of Scrapy, then it worked for me. Instead of installing version 2.6.3, I installed 2.6.2:
pip install Scrapy==2.6.2
I use PyCharm 2022.2.3 (Professional Edition) on Windows.
I am attempting to install dlib to my python virtual environment.
There is a very similar problem here and I followed the exact steps to no avail.
Somehow I am able to import dlib when running code and I managed to do that by git cloning git clone -b pybind11 https://github.com/supervacuus/dlib.git.
But when I attempt to install it pip3 install dlib or a library that depends on it such as pip3 install face_recognition I get errors stating that ERROR: Failed building wheel for dlib
Full execution logs and error here https://gist.github.com/GhettoBurger996/1e6a423b88b7435c8759255e19fa5e60
I am using 3.5.2 and Ubuntu 16.04
Question is a bit old but I ran into a similar problem where installing dlib using pip3 would fail.
Installing the following dependencies fixed it for me:
$ sudo apt-get install build-essential cmake
$ sudo apt-get install libgtk-3-dev
$ sudo apt-get install libboost-all-dev
From the posted error logs it seems that you had cmake installed already so the first line might not be necessary for you.
I am trying to install scrapy-deltafetch on ubuntu 14 using pip (v8.1.2 on python 2.7). When I run (sudo) pip install scrapy-deltafetch, I get the following error:
Update:
Complete output from command python setup.py egg_info:
Can't find a local Berkeley DB installation.
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-TVr3UZ/bsddb3/
Any thoughts on how to resolve this?
I have already ran the following:
sudo python ez_setup.py
pip install --upgrade setuptools
as well as
sudo apt-get install python-setuptools
I do have both python3 and python 2.7 on the computer.
I have tried installing bsdb3 but that does not work either. I will look into setting up berkeley db correctly and update here accordingly
Update:
Installing berkeley DB did not solve the issue.
scrapy-deltafetch requires bsddb3.
bsddb3 itself, on Ubuntu Trusty, depends on libdb5.3.
You can either install python-bsddb3 with apt-get, or only apt-get install libdb5.3. pip install scrapy-deltafetch should work after that.
Install libbd-dev first,
sudo apt-get install libdb-dev
then install deltafetch,
# for python2
sudo -H pip install scrapy-deltafetch
# for python3
sudo -H pip3 install scrapy-deltafetch
I'm trying to install Pillow for Python and i run this command on the terminal
sudo pip install Pillow
and i get this error
clang: error: no such file or directory: 'build/temp.macosx-10.10-intel-2.7/_imagingtk.o'
clang: error: no such file or directory: 'build/temp.macosx-10.10-intel-2.7/Tk/tkImaging.o'
error: command 'cc' failed with exit status 1
Any solutions for this? i tried looking in stack overflow only similar errors but not the same one
This might be the same as this bug in Pillow 2.5.0.
It's been fixed, to be released soon in 2.5.1.
To test the dev version:
sudo pip install git+https://github.com/python-pillow/Pillow.git
Or install version 2.4.0:
sudo pip install pillow==2.4.0
Edit: Pillow 2.5.1 has now been released so you can just do:
sudo pip install pillow
First: Install python-dev
apt-get install python-dev
After: install PILLOW
pip install pillow
$ sudo easy_install pip==20.3.4
$ sudo apt-get build-dep pillow
$ sudo pip2 install pillow
Successfully installed pillow-6.2.2
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial.
It was run on 32bit Chromenotebook
Try running this command:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow
(You may find additional possible answers at this similar question: Installing Pillow/PIL on Mavericks)
If you're on macOS, try: brew install libtiff libjpeg webp littlecms