How to install python easy_install with Python 3 - python

Sorry if this is any easy question
I want to install easy_install for Python 3. Ive tried downloading ezsetup.py and running it but I get this
`Traceback (most recent call last):
File "/Users/Ivan/Desktop/ez_setup.py", line 364, in <module>
sys.exit(main())
File "/Users/Ivan/Desktop/ez_setup.py", line 360, in main
downloader_factory=options.downloader_factory)
File "/Users/Ivan/Desktop/ez_setup.py", line 283, in download_setuptools
log.warn("Downloading %s", url)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/log.py", line 47, in warn
self._log(WARN, msg, args)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/log.py", line 30, in _log
if stream.errors == 'strict':
AttributeError: errors`
Next, I tried using wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py but I get this:
`wget: command not found`
Any help would be appreciated.

Related

pip3 not installing packages

I enter the following line into terminal:
pip3 install numpy
this gives me:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 9, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip3')()
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
Im thinking its a path issue but im not really sure.
This is a bug with the distro package vendored by pip. The bug has been solved but the latest version of pip uses and very old version of distro which doesn't have this bug fix applied.
For now, you can simply try to make the executable available in the path.

TyperError installing jupyter

I'm trying to install jupyter on Ubuntu 14.04 LTS but I keep getting this error. I tried giving permissions to every folder and run the code as:
sudo -H pip3 install --user jupyter
But nothing worked. I also did the update on pip and it's running the latest version.
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/root/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/root/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/root/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/root/.local/lib/python3.4/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
Thanks for the help!
For me it works with the recent pyparsing package. Perhaps you need to upgrade your pyparsing to the recent version. If you installed it with apt-get, you need to remove the python3-pyparsing package, and install it with pip3.
sudo apt remove python3-pyparsing
sudo pip3 install pyparsing
As this answer writes, you need pyparsing>=2.0.2 to avoid this error.
I had this error as well, after a bit of digging I found this question that addresses the same error caused by some other software.
As the author states, the problem is that the call to MARKER_EXPR() should have a 'name' argument but it doesn't.
To fix this, edit line 59 of /usr/local/lib/python3.4/dist-packages/packaging/requirements.py and just add quotes to the call to MARKER_EXPR() like so:
MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")

Setuptools installation in Jython

Latest Jython standalone (2.7 final), latest setuptools:
C:\projects_intellij\test_jython>jython.bat ez_setup.py
C:\projects_intellij\test_jython>java -jar "C:\projects_intellij\test_jython\jython-standalone-2.7.0.jar" ez_setup.py
Extracting in C:\Users\myuser\AppData\Local\Temp\tmpt_1anc
Now working in C:\Users\myuser\AppData\Local\Temp\tmpt_1anc\setuptools-21.2.2
Installing Setuptools
Traceback (most recent call last):
File "ez_setup.py", line 425, in <module>
sys.exit(main())
File "ez_setup.py", line 422, in main
return _install(archive, _build_install_args(options))
File "ez_setup.py", line 59, in _install
if not _python_cmd('setup.py', 'install', *install_args):
File "ez_setup.py", line 51, in _python_cmd
return subprocess.call(args) == 0
File "C:\projects_intellij\test_jython\jython-standalone-2.7.0.jar\Lib\subprocess.py", line 500, in call
File "C:\projects_intellij\test_jython\jython-standalone-2.7.0.jar\Lib\subprocess.py", line 830, in __init__
File "C:\projects_intellij\test_jython\jython-standalone-2.7.0.jar\Lib\subprocess.py", line 1311, in _execute_child
TypeError: args must contain only strings
Is there a way to install this using Jython? Should I have used Jython installed by the installer instead of standalone?
Platform: Win 7 x64.
Yes, I think you should have.
It looks like a version problem.
Same here:
https://sourceforge.net/p/jython/mailman/jython-users/thread/CAOhO%3DaNmNL6xeKES2JXPkg%2BP3OTBxJCESNA0YtfLVX1L1fv85w#mail.gmail.com/

AttributeError when trying to install using pip

I'm running Python 2.7.9 on Yosemite (10.10.2), and my pip installation has gone wrong.
I can no longer install pip using get-pip.py:
sth:~ $ sudo python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20204, in <module>
main()
File "get-pip.py", line 152, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 130, in bootstrap
sys.exit(pip.main(["install", "--upgrade"] + packages + args))
File "/tmp/tmpdUeSSr/pip.zip/pip/__init__.py", line 217, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/basecommand.py", line 183, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 565, in dictConfig
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 332, in configure
AttributeError: 'module' object has no attribute '_handlerList'
I can use easy_install, and then create a symlink to it in /usr/local/bin, but trying to install using it gives me the same error, subsequently:
sth:~ $ sudo pip install twine
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==6.0.8', 'console_scripts', 'pip')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line 183, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig
dictConfigClass(config).configure()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure
del logging._handlerList[:]
AttributeError: 'module' object has no attribute '_handlerList'
I'm certain it's not a problem with pip, so wondering what I've done wrong…
Sorry for necroing but for the sake of other googlers:
As pointed out here, you should not install logging with pip as it messes up the system version. I am not sure when this changed though.
So removing yourpythoninstallpath/lib/python2.7/site-packages/logging should remove the error.
I'd gotten a similar error an hour ago and found this question.
However I've solved it just now.
Although you might not think it useful, I hope this answer helps you solving the problem.
In fact, when I use virtualenvwrapper, I want to control an ENV suddenly.
So I created a backup directory for the reason in the same directory where another ENV is.
After that, There were not only 2 ENVs but also 3 directories related to ENV in .virtualenv.
It made some path to site-packages and etc change helter-skelter apparently.
That is why, if you don't confirm the files about Virtualenv, I reccomend you to do.
The error with me is the following.
~ pip freeze
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==6.0.6', 'console_scripts', 'pip')()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/basecommand.py", line 183, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig
dictConfigClass(config).configure()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure
del logging._handlerList[:]
AttributeError: 'module' object has no attribute '_handlerList'

Can't create virtualenv with jython 2.7b2 as an interpreter

I want to execute some Java code from Python so I've decided to install standard python interpreter, jython and join them together using pyro4. Pyro4 requires python > 2.5 so I choose to use jython 2.7b. Here are steps I made to make this happen:
wget -i jython-installer-2.7-b2.jar http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7-b1/jython-installer-2.7-b2.jar
java -jar jython-installer-2.7-b2.jar
jython2.7b2/bin/virtualenv-2.7 oscar
And this is what I'm getting back:
Cannot find file /home/mnowotka/jython2.7b2/Include (bad symlink)
New jython executable in oscar/bin/jython
Installing setuptools.................
Complete output from command /home/mnowotka/oscar/bin/jython -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /home/mnowotka/jytho...ols-0.6c11-py2.7.egg:
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Traceback (most recent call last):
File "<string>", line 278, in <module>
File "<string>", line 210, in main
File "<string>", line 161, in download_setuptools
File "/home/mnowotka/jython2.7b2/Lib/socket.py", line 1651, in read
data = self._sock.recv(recv_size)
File "/home/mnowotka/jython2.7b2/Lib/httplib.py", line 567, in read
s = self.fp.read(amt)
File "/home/mnowotka/jython2.7b2/Lib/socket.py", line 1669, in read
data = self._sock.recv(recv_size)
File "/home/mnowotka/jython2.7b2/Lib/socket.py", line 174, in handle_exception
raise _map_exception(jlx)
socket.error: [Errno 32] Socket closed
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "jython2.7b2/bin/virtualenv-2.7", line 3, in <module>
virtualenv.main()
File "/home/mnowotka/jython2.7b2/Lib/site-packages/virtualenv.py", line 970, in main
create_environment(home_dir,
File "/home/mnowotka/jython2.7b2/Lib/site-packages/virtualenv.py", line 1090, in create_environment
install_setuptools(py_executable, unzip=unzip_setuptools,
File "/home/mnowotka/jython2.7b2/Lib/site-packages/virtualenv.py", line 610, in install_setuptools
_install_req(py_executable, unzip,
File "/home/mnowotka/jython2.7b2/Lib/site-packages/virtualenv.py", line 579, in _install_req
call_subprocess(cmd, show_stdout=False,
File "/home/mnowotka/jython2.7b2/Lib/site-packages/virtualenv.py", line 1055, in call_subprocess
raise OSError(
OSError: Command /home/mnowotka/oscar/bin/jython -c "#!python
\"\"\"Bootstra...sys.argv[1:])
Does it mean that jython 2.7b2 is not quite ready yet or I'm doing something wrong?
Use this ez_setup.py to install setuptools:
added setuptools-egg and md5

Categories