Not able to install django-allauth in ubuntu 18.04.6 LTS - python

I'm trying to add social authentication in my project but when I try to install django-allauth it is giving me error I've tried this post but no luck it's giving me another error related to setuptools_rust I've given commands I've tried and errors related to each command.
$ pip3 install django-allauth
Error :
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-7e3fgl32/cryptography/setup.py", line 14, in
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
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
=============================DEBUG ASSISTANCE==========================
---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-7e3fgl32/cryptography/
Then I tried to install setuptools_rust as it causing error
$ pip3 install setuptools_rust
This package does not give me any error it installed successfully
Then I've tried to install some commands from this post
$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev
It did not change anything check response of command
Reading package lists...
Done Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
libffi-dev is already the newest version(3.2.1-8).
python-dev is already the newest version (2.7.15~rc1-1).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.14).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
and finally I've tried this command
$ pip3 install cryptography
Error :
Collecting cryptography
Using cached https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/tmp/pip-build-yp90u93b/cryptography/setup.py", line 54, in <module>
rust_version=">=1.41.0",
File "/home/dev/Ankit/new/afterlife_env/lib/python3.6/site-packages/setuptools/__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "/home/dev/Ankit/new/afterlife_env/lib/python3.6/site-packages/setuptools/__init__.py", line 142, in _install_setup_requires
dist = MinimalDistribution(attrs)
File "/home/dev/Ankit/new/afterlife_env/lib/python3.6/site-packages/setuptools/__init__.py", line 134, in __init__
distutils.core.Distribution.__init__(self, filtered)
File "/home/dev/Ankit/new/afterlife_env/lib/python3.6/site-packages/setuptools/dist.py", line 457, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/pip-build-yp90u93b/cryptography/setup.py", line 88, in <module>
version = pkg_resources.get_distribution(dist).version
AttributeError: module 'pkg_resources' has no attribute 'get_distribution'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-yp90u93b/cryptography/setup.py", line 89, in <module>
except pkg_resources.DistributionNotFound:
AttributeError: module 'pkg_resources' has no attribute 'DistributionNotFound'
=============================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/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.6.9
platform: Linux-4.15.0-166-generic-x86_64-with-Ubuntu-18.04-bionic
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-yp90u93b/cryptography/

It seems pip3 install --upgrade pip not worked for me then I tried this way and it worked
python3 -m pip install --upgrade pip
Thanks to this post
for Python 3:
python3 -m pip install --upgrade pip
for Python 2:
python2 -m pip install --upgrade pip
for Python:
python -m pip install --upgrade pip

Related

ModuleNotFoundError: No module named 'setuptools_rust' when installing packages [duplicate]

This question already has an answer here:
Not able to install django-allauth in ubuntu 18.04.6 LTS
(1 answer)
Closed 8 months ago.
I'm trying to install paramiko using pip package on centos7 OS and getting issues like as below and installed python3 with below command
yum install -y python3
[root#test ~]# pip3 install paramiko
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting paramiko
Using cached https://files.pythonhosted.org/packages/04/e5/39ec73dd4a8769d6759b8d6c60a1b2c9337f585407c2ae8bfb8ccb734278/paramiko-2.11.0-py2.py3-none-any.whl
Collecting cryptography>=2.5 (from paramiko)
Using cached https://files.pythonhosted.org/packages/51/05/bb2b681f6a77276fc423d04187c39dafdb65b799c8d87b62ca82659f9ead/cryptography-37.0.2.tar.gz
Complete output from command python setup.py egg_info:
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
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
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ccbam6fs/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ccbam6fs/cryptography/
Just need to Upgrade pip package
pip3 install --upgrade pip
or
pip install --upgrade pip

Problems Installing pip on CentOS 5.x

I have pip installed:
[amr#h2oamr kits]$ python get-pip.py
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
However, I'm getting this error when trying to install Django:
[amr#h2oamr kits]$ pip install django
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in ?
from pip import main
ImportError: No module named pip
I am stuck trying to move forward. I installed pip as recommended by using a get-pip.py module I downloaded.
This upgrade also did not work.
[amr#h2oamr kits]$ pip install --upgrade pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in ?
from pip import main
ImportError: No module named pip
How can I remove pip altogether, and then re-install it?
you can use the command $ rm pip to remove pip and then $sudo apt-get install pip to get the latest version

Troubles installing mysqlclient with pip3

I'm trying to set up a python 3.6 environment with Django. The installation instructions say I should install mysqlclient to be able to connect to mySQL. I get this:
dennis#django:~$ sudo -H pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.10.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-4jiw3hvk/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-4jiw3hvk/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-4jiw3hvk/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4jiw3hvk/mysqlclient/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
mySQL is properly installed. What should be in the mysql_config file?
When I try to upgrade pip3 I get this:
dennis#django:~$ sudo -H pip3 install --upgrade pip3
Collecting pip3
Could not find a version that satisfies the requirement pip3 (from versions: )
No matching distribution found for pip3
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
After installing mysqlclient with pip3, I noticed that the module was installed in the python3.5 directory instead of in the python3.6 directory so when I tried to import the MySQLdb module running python3.6, it was not found
dennis#django:~/python_db$ python
Python 3.6.0+ (default, Feb 4 2017, 11:11:46)
[GCC 5.4.1 20161202] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'MySQLdb'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'MySQLdb'
>>>
I then reran using python 3.5 and it was found. How do I install modules using pip3 into the 3.6 directory?
If you're using Mac OS, try this:
brew install mysql
If you're using Ubuntu14/16, try this:
sudo apt install libmysqlclient-dev
and one more:
pip3 can be updated with sudo pip3 install -U pip
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
In my case the issue was solved by doing the following:
sudo aptitude install libmysqlclient-dev
As I was using Python 3.x, the following was also necessary:
sudo aptitude install python3-dev
If you're running MAMP on OSX, do this:
export PATH=$PATH:/Applications/MAMP/Library/bin
In Debian Stretch the required package name seems to have changed to default-libmysqlclient-dev
https://packages.debian.org/stretch/default-libmysqlclient-dev
you can try this to install mysql to a particular python directory, for example w/ python 3.6
sudo python3.6 /usr/bin/pip3 install mysqlclient
Looking over this old question (while looking for something else), I observe that the problem could be that the directory containing mysql_config was not in the current $PATH. Apparently that's what the install script uses to try to find it. It's possible for "mysql to be installed," but not on the $PATH – or for the $PATH to refer to the wrong version.

Error when installing github module via pip

I'm trying to download a python module from github using pip, but I seem to be running into problems upon download:
00000#ubuntu-00000:~/Desktop/Python/Blockchain.data$ pip install git+https://github.com/luke-jr/eloipool.git
You are using pip version 7.0.3, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting git+https://github.com/luke-jr/eloipool.git
Cloning https://github.com/luke-jr/eloipool.git to /tmp/pip-f159a1wz-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 18, in <module>
File "/home/00000/anaconda3/lib/python3.4/tokenize.py", line 438, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-f159a1wz-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-f159a1wz-build
Any insight into why this isn't installing?
I experienced a similar problem when installing selenium recently. Firstly upgrade your PIP. Then try installing what ever you are trying to install.
Module did not contain a setup.py file.
Ended up doing:
git clone https://ADDRESS .

installed patsy, still can't install statsmodels

When I do pip install statsmodels it gives me ImportError: statsmodels requires patsy. http://patsy.readthedocs.org, but then I run pip install patsy and it says its successful, but running pip install statsmodels still gives me same error about requiring patsy.
How can this be?
$ sudo pip install patsy
Requirement already satisfied (use --upgrade to upgrade): patsy in /Library/Python/2.7/site-packages/patsy-0.3.0-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): numpy in /Library/Python/2.7/site-packages/numpy-1.8.2-py2.7-macosx-10.9-intel.egg (from patsy)
Cleaning up...
$ sudo pip install statsmodels
Downloading/unpacking statsmodels
Downloading statsmodels-0.5.0.tar.gz (5.5MB): 5.5MB downloaded
Running setup.py (path:/private/tmp/pip_build_root/statsmodels/setup.py) egg_info for package statsmodels
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 463, in <module>
check_dependency_versions(min_versions)
File "/private/tmp/pip_build_root/statsmodels/setup.py", line 122, in check_dependency_versions
raise ImportError("statsmodels requires patsy. http://patsy.readthedocs.org")
ImportError: statsmodels requires patsy. http://patsy.readthedocs.org
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/statsmodels
Storing debug log for failure in /Users/Jacob/Library/Logs/pip.log
What the error message doesn't tell you is that the module six not being there is really the problem.
Found this out by doing import patsy and having it fail and tell me that I needed six. So I did pip install six and now the patsy import worked, as did the pip install statsmodels.
For me:
$python3 -m pip install --upgrade patsy
$python3 -m pip install statsmodels
worked!
For anyone still experiencing issues, I highly recommend this site:
Python libraries. I'm using Python 3, so I,
Downloaded the file named: statsmodels‑0.8.0‑cp35‑cp35m‑win_amd64.whl
Opened windows command prompt
Went to my Downloads directory (cd Downloads)
And then used pip (pip install statsmodels‑0.8.0‑cp35‑cp35m‑win_amd64.whl)
I also had an issue with this in Python 3.4. It worked using the WHL statsmodel file at this link: https://pypi.python.org/pypi/statsmodels#downloads
After the download I installed it using: pip3.4 install my_directory\statsmodels-0.8.0rc1-cp34-none-win_amd64.whl, where my_directory is where I put the WHL file.

Categories

Resources