I can't install python-ldap via pip, I get the following error:
$ sudo pip3.4 install python-ldap
Downloading/unpacking python-ldap
Downloading python-ldap-2.4.19.tar.gz (138kB): 138kB downloaded
Running setup.py (path:/tmp/pip_build_root/python-ldap/setup.py) egg_info for package python-ldap
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/python-ldap/setup.py", line 53
print name + ': ' + cfg.get('_ldap', name)
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/python-ldap/setup.py", line 53
print name + ': ' + cfg.get('_ldap', name)
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/python-ldap
Storing debug log for failure in /home/nima/.pip/pip.log
Any ideas how to resolve this?
It seems that your python-ldap is implemented in Python-2.X but you're using Python-3.X (Print Is A Function in python 3). Therefore, you need to install a newer version of this library that supports Python-3.X or install the library in python-2.X which is not recommended.
You can install the proper version for Python-3.X though using following command:
# if pip3 is the default pip alias for python-3
pip3 install python3-ldap
# otherwise
pip install python3-ldap
Also here is the link of PiPy package for further information. https://pypi.python.org/pypi/python3-ldap/0.9.8.4/
You can install python-ldap which is implemented for python3
pip install python3-ldap
Related
I am not able to install pyspark or upgrade pip. I keep running into syntax error. I do not have this issue if I use pip3 however the program that runs the code must use python27
#### Installing pyspark using root
$python -V
Python 2.7.18
$pip install pyspark
Collecting pyspark
Using cached
https://files.pythonhosted.org/packages/b8/01/b2393cee7f6180d9150274e92c8bdc1c81220e2ad7554ee5febca1866899/pyspark-3.3.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-l7QVd5/pyspark/setup.py", line 31
file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l7QVd5/pyspark/
You are using pip version 8.1.2, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
##### Upgrading pip using root
$pip install --upgrade pip
Cache entry deserialization failed, entry ignored
Collecting pip
Downloading
https://files.pythonhosted.org/packages/4b/b6/0fa7aa968a9fa4ef63a51b3ff0644e59f49dcd7235b3fd6cceb23f202e08/pip-22.1.2.tar.gz (2.1MB)
100% |████████████████████████████████| 2.1MB 388kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-9iqM1O/pip/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9iqM1O/pip/
You are using pip version 8.1.2, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Ok so i'm trying to install scapy for python3, but ive been having some issues
when I enter this command:
pip install scapy
This is the output:
Collecting scapy
Using cached scapy-2.3.3.tgz
In the tar file C:\Users\MYNAME~1\AppData\Local\Temp\pip-oao3meyq-
unpack\scapy-2.3.3.tgz the member scapy-2.3.3/README
is invalid: unable to resolve link inside archive
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-
qjegdxw6\scapy\setup.py", line 36
os.chmod(fname, 0755)
^
SyntaxError: invalid token
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-qjegdxw6\s
capy\
So then I searched around and I tried using this:
pip3 install scapy-python3
But it just says that pip3 isnt a command, so im not sure what to do
Instead of pip3 use pip
pip install scapy-python3
It worked for me. pip3 is usually used if you have both python2 and python3 installed on your machine. It is uesd to distinguish between different pips in your system.
The pip3.exe will be in python3x/scripts/.
Check if there is a pip3.exe is available in your scripts folder.
If the above solution doesn't work for you then try giving the full path of correct pip.exe.
pip3 install -U django-socketio outputs the following errors python version on this environment is 3.4.3. The same thing appears when I try to install django channels on python 3.5 or higher
Collecting django-socketio
Downloading django-socketio-0.3.9.tar.gz (48kB)
100% |████████████████████████████████| 51kB 204kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-j3y67yvi/django-socketio/setup.py", line 7, in <module>
version = __import__("django_socketio").__version__,
File "/tmp/pip-build-j3y67yvi/django-socketio/django_socketio/__init__.py", line 2, in <module>
from django_socketio.utils import NoSocket, send, broadcast, broadcast_channel
File "/tmp/pip-build-j3y67yvi/django-socketio/django_socketio/utils.py", line 44
except IndexError, KeyError:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j3y67yvi/django-socketio/
I tried to install it using pip but I was unsuccessful.
What you can do is:
1) download the Source Code from GitHub to where you want the files to be
git clone https://github.com/stephenmcd/django-socketio
2) unzip it and go inside the django-socketio directory
3) run:
python3 setup.py install
you can check if it has installed by running the command:
pip3 freeze
hope this helps!
I've recently done a clean install of Python 3.6 on my Windows 10 laptop.
I wish to install BeautifullSoup. When i try to use
python -m pip install BeautifulSoup
it returns the following:
C:\Users\mjpvanzuijlen\AppData\Local\Programs\Python\Python36>python -m pip install BeautifulSoup
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MJPVAN~1\AppData\Local\Temp\pip-build-kopzhsyx\BeautifulSoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\MJPVAN~1\AppData\Local\Temp\pip-build-kopzhsyx\BeautifulSoup\
I found others with similair problems with egg_info, but the solutions did not work for me. I have tried to upgrade pip, i downloaded setuptools32.3.2.1, i've upgraded setupttools but all to no avail.
It looks like you are trying to install the wrong package.
Try running: python -m pip install BeautifulSoup4
instead of: python -m pip install BeautifulSoup
I am trying to build a script that makes use of scikit-image on Travis-ci. It complains that six is not up to date. Just to be sure, I tried to replicate the .travis.yml of the scikit-image project on github, but it did nothing to change the situation. I also tried to update six, but to no avail...
Does someone know how to build scikit-image on travis?
My requirements.txt:
# Requirements list:
scikit-image
My trace:
$ source ~/virtualenv/python3.3/bin/activate
$ python --version
Python 3.3.5
$ pip --version
pip 6.0.7 from /home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages (python 3.3)
5.80s$ pip install -r requirements.txt
You are using pip version 6.0.7, however version 6.0.8 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting scikit-image (from -r requirements.txt (line 2))
Downloading scikit-image-0.10.1.tar.gz (16.7MB)
100% |################################| 16.7MB 20kB/s
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-wsd_vd/scikit-image/setup.py", line 110, in <module>
check_requirements()
File "/tmp/pip-build-wsd_vd/scikit-image/setup.py", line 105, in check_requirements
% ((package_name, ) + min_version))
ImportError: You need `six` version 1.3 or later.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-wsd_vd/scikit-image/setup.py", line 110, in <module>
check_requirements()
File "/tmp/pip-build-wsd_vd/scikit-image/setup.py", line 105, in check_requirements
% ((package_name, ) + min_version))
ImportError: You need `six` version 1.3 or later.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wsd_vd/scikit-image
The command "pip install -r requirements.txt" failed and exited with 1 during .
Your build has been stopped.
If you get an error that a specific dependency isn't being met, being more specific about that dependency usually helps. I like to put dependencies that I don't directly use in a before_install section.
before_install:
pip install six>=1.3
install:
pip install -r requirements.txt
pip allows you to specify constraints on the versions of packages you install. If you had to use 1.3 exactly you could use ==.