error installing cryptography on centos - python-2.7

when I try to install Cryptography I have this error
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distributio
n option: 'zip_safe'
warnings.warn(msg)
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distributio
if not self.distribution.include_package_data:
AttributeError: Distribution instance has no attribute 'include_package_data'
I try to install it from pip & easy_install and same error
how can I fix it?
thx.

I would first try getting rid of that first warning.
As said SO question: Distribute has been merged into Setuptools as of version 0.7. If you are using a version <=0.6, upgrade using
pip install --upgrade setuptools
or
easy_install -U setuptools

Related

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-YYFUnW/psycopg2/

I'm trying to install requirements.txt file in python 2.7 in ubuntu but i get ERROR:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-YYFUnW/psycopg2/
What exactly does that mean, and how do I fix it? I already tried these commands:
apt-get install python-bs4
sudo install --upgrade setuptools
sudo apt-get update
Error Image :
This error can occur because of the version of psycopg2==2.6.2 you are trying to install. I did face this error while installing this version of psycopg2. So to avoid this error, you can use another version of it or the latest version as:
pip install psycopg2
Also, psycopg2 is going to be renamed from release of version 2.8, so it is recommended to install it using:
pip install psycopg2-binary
If you are installing psycopg2 from a requirements.txt file, you can comment out the package listed in the file as:
# psycopg2==2.6.2
Then install the package as suggested above, then install other requirements from the file with the package name still commented.

Error when i install pip in python2.7 in window

i am try to install pip for Django in python2.7(window7) when i try to run
python get-pip.py i get error in cmd.
python get-pip.py
could not find a version that satisfies the requirement pip no matching distribution found for pip
Upgrade to a newer version of python.
Refer: https://github.com/pypa/pip/issues/5357

Error while running PIP command "no module packaging exists"

I have tried many approaches in resolving this issue but still cannot resolve it can someone please help me.
when I try to run the pip to install any new package it is ending in error with the message no module named packaging.version. This is happening in the __init__.py file where there are import command import packaging.version.
I tried to install the packaging package by using the command pip install packaging even that ended in failure with the same error.
Then I tried to install this package using the apt-get command
sudo apt-get install python-packaging but it ended saying could not find the package.
Finally I tried to update the setuptools package to version 33.1.1 as a part of the previous solutions approaches, but can't do it with pip(same issue as above) so I used the apt-get command
sudo apt-get install setuptools=33.1.1 but it is saying no package with this version found error.
I am out of ideas can someone please help. Appreciate your help.
I believe that your version of pip is obsolete. Try running pip install --upgrade pip.
If you cant do it (still the same error), I'd suggest to reinstall pip.
You can do it with get-pip.py file. Here you can find a quick guide: Installing pip setuptools and wheel.
You may also be able to reinstall it with python -m pip install -U pip.

pip is error,TypeError: __call__() takes exactly 2 arguments (1 given)

system
centos 7.2
Python 2.7.5
install
I install webhook
pip install webhook
### but hava error,then
yum install python-devel -y
## go on,pip doesn't workding
pip
error
Enter the command contain pip.Then
[root#location src]# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
So,what should I do?!
I had the same problem on a fresh virtualenv and apparently this is a conflict between the version requirements for packaging, pip and pyparsing with the new setuptools. What worked for me was to pin down the old one.
pip install setuptools==33.1.1
Update:
As another answer pointed out, pip has already fixed the bug, so you should try upgrading it instead of using the workaround above.
python -m pip install --upgrade --force pip
UPDATE:
Please see the solution lower in this thread by Pedro Werneck instead of this one. It's the correct way to solve the problem.
Preface: I do not recommend this!
This seems to work, but I have no idea what the consequences could be. This is cargo cult programming at its best! I'm only adding it here in case it can help someone in a bind.
I made changes to the file requirements.py where the error occurred. For #hysg, that would be this file:
/usr/lib/python2.7/site-packages/packaging/requirements.py
On me on OS X, it's here:
/Library/Python/2.7/site-packages/packaging/requirements.py
I modified the the offending line by removing the parentheses for the call to MARKER_EXPR, as demonstrated below:
#MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")
And that worked.
Again, please be careful! I don't know what I'm doing and this could potentially cause more harm than good.
this is work well:
python -m pip install --upgrade --force pip
pip install setuptools==33.1.1
This is what worked for me:
pip install setuptools==33.1.1
It downgraded setuptools from 35.0.1 to 33.1.1 and pyparsing 1.5.7 installed!
Use the following command to upgrade pip, which has the bug fixed:
python -m pip install --upgrade --force pip
It worked for me (centos 7, python 2.7).
For more details: GitHub
I applied the fix
pip install setuptools==33.1.1
and it solved the problem for OSX 10.10.5 (Yosemite)
I ran into the same problem on a new virtualenv trying to install. I'm running python 2.7.11 and found the two commands belows solve the versioning problem with setuptools:
This forces a pip upgrade, which has a fix for the bug, but doesn't reinstall setup tools, so I was still running on setuptools version 35.0.1
python -m pip install --upgrade --force pip
This sets setuptools to an older version.
pip install setuptools==33.1.1
After this, I successfully installed my requirements.
None of the other uninstall/reinstall/force answers worked for me, but on OS X 10.10.5 with the system Python 2.7.10, I was able to do:
pip uninstall packaging pip
easy_install pip # this installed pip 1.4.1
pip install --upgrade pip # and this upgraded to the current pip
and I was then able to import pkg_resources without a problem.
Should really learn to stop messing with the system Python…
Actually, I had a problem that OS/system which means root, not sudo, has been the owner of the pip2 package. But after I had executed this command:
sudo apt-get remove python-pip
it worked like a charm.
Noting, of course that I have a debian distribution.
And then I used what Pedro suggested:
sudo pip install setuptools==33.1.1
It worked for me too (centos 7, python 2.7).
python -m pip install --upgrade --force pip
pip install setuptools==33.1.1

installing pyobjc on mac osx 10.9

I'm trying to download pyobjc on my mac, which runs on 10.9.3. I've tried using easy_install, pip, and manual install. I have setuptools installed with Xcode 5.
When I use easy_install, pip, or manual install I get the error: AttributeError: 'module' object has no attribute '_install_lib' right before it quits, along with other errors before this. For easy_install I type the following line in the terminal:
easy_install -U pyobjc
and for pip I use:
pip -U pyobjc
for manual install I use:
python setup.py install
I too was having this problem, also described here. It seems to be a problem with setuptools. I was able to successfully install PyObjC by reinstalling setuptools first, i.e.:
$> sudo pip uninstall setuptools
$> pip install setuptools
$> pip install pyobjc
Hope that helps.
I think this was fixed in pyobjc 2.5.1.