My OS is CentOS 6, which contains python 2.6.6 as default. I installed python 2.7 in /usr/local/.....
I tried to use pip to install pygtk in the first place, but it didn't work. So I decided to install it manually. I use:
./configure --prefix=/usr/local/lib/python2.7/site-packages
The error message shows the default version is python 2.6.6, it tried to install in /usr/local/lib/python2.6/... which of course does not exit. I also defined alias of python as python2.7, so when I type python, it will assume it's python2.7. But here it didn't work this way. Any suggestions? Thanks!
BTW: The error message when I installed the pygtk by pip is:
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pygtk
Storing debug log for failure in /root/.pip/pip.log
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1229, in prepare_files req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 325, in run_egg_info command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd)) InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pygtk
Related
I am trying to install the python module pyobjus (this is the one that fails to install another module).
But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:
$ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
Using cached pyobjus-1.2.0.tar.gz (165 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
cwd: /tmp/pip-install-4k26drr5/pyobjus
Complete output (19 lines):
Pyobjus platform is linux
Traceback (most recent call last):
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 35, in <module>
class PyObjusBuildExt(build_ext, object):
NameError: name 'build_ext' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.
Any help would be greatly appreciated.
My OS is Linux Mint 19.3.
I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?
Edit adter Marat's suggestion:
I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...
Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...
I am trying to install pyobjc-core which is a requirement for pyautogui. I am getting the below error while installing. I have already updated setuptools using
pip3 install --upgrade setuptools
and also using
sudo python3 ez_setup.py
I am on OSX Yosemite and using Python 3.5.
I see that the code below has a requirement for xcode. Could that be the reason and why would xcode be needed for this installation?
pip3 install pyobjc-core
Collecting pyobjc-core
Using cached pyobjc-core-3.1.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/pyobjc_core.egg-info
writing include/pyobjc-compat.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-compat.h
writing include/pyobjc-api.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-api.h
writing namespace_packages to pip-egg-info/pyobjc_core.egg-info/namespace_packages.txt
writing top-level names to pip-egg-info/pyobjc_core.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pyobjc_core.egg-info/dependency_links.txt
writing pip-egg-info/pyobjc_core.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/pyobjc_core.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 696, in
**parse_package_metadata()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 371, in run
egg_info.egg_info.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 193, in run
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 216, in find_sources
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 300, in run
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/egg_info.py", line 329, in add_defaults
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/setuptools/command/sdist.py", line 132, in add_defaults
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/setup.py", line 525, in finalize_options
universal_newlines=True).strip()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 629, in check_output
**kwargs).stdout
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 711, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/xcodebuild', '-version', '-sdk', 'macosx', 'Path']' returned non-zero exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zw/573csqzn0pnbjkb44gw2s7800000gn/T/pip-build-72bxsxfe/pyobjc-core/
The error is clear: you need xcode...
It's silly but unfortunately there are these developer tools that are tied to it, and since many packages require dev tools (in your specific case xcodebuild needs it) you have to install xcode (anyway it's free)
I'm trying to install selenium library for python on my Ubuntu machine using pip installer.
I receive the following error:
pip install selenium
Exception: Traceback (most recent call last): File
"/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in
main
status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 304,
in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File
"/usr/lib/python2.7/dist-packages/pip/req.py", line 1230, in
prepare_files
req_to_install.run_egg_info() File "/usr/lib/python2.7/dist-packages/pip/req.py", line 293, in
run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name)) File
"/usr/lib/python2.7/dist-packages/pip/req.py", line 285, in setup_py
if six.PY2 and isinstance(setup_py, six.text_type): AttributeError: 'module' object has no attribute 'PY2'
I am currently using Python 2.7.9
python --version
Python 2.7.9
Solved upgrading six
pip install --upgrade six
This is a head stumper so I am posting this question AFTER having examined and read all of the prior posts on this issue.
Running OSX 10.9 Python 2.7 no virtualenv
pip install awssh
Downloading/unpacking awssh
Downloading awssh-0.1.tar.gz
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/basecommand.py",
line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/commands/install.py",
line 274, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/req.py",
line 1215, in prepare_files
req_to_install.run_egg_info()
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/req.py",
line 288, in run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/req.py",
line 265, in setup_py
import setuptools
File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extension import Extension
File "/Library/Python/2.7/site-packages/setuptools/extension.py", line 8, in <module>
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 21, in <module>
packaging = pkg_resources.packaging
AttributeError: 'module' object has no attribute 'packaging'
This error is caused by the presence of an outdated version of pkg_resources. In order to get rid of the error, do the following:
Start a python session, import pkg_resources, and view the file from which it is loaded:
In [1]: import pkg_resources
In [2]: pkg_resources.__file__
Out[2]: '/usr/lib/python2.7/dist-packages/pkg_resources.pyc'
Remove this file (and the associated *.py file):
$ sudo rm /usr/lib/python2.7/dist-packages/pkg_resources.py*
That's it! Re-run the installation; it should complete without any errors:
$ sudo pip install awssh
Warning
If you're on a Debian based Linux system, this file might have been installed via the python-pkg-resources package. Therefore updating or reinstalling this package will reinstate the stale module! Also be aware that you're messing with a file which is supposed to be controlled by apt.
I have set Canopy as my default python compiler.
I want to install scikits modules, currently not available in Canopy Package manager. I have installed setup tools and easy_install, pip which points to Canopy installation ( which easy_install -> Canopy directory). But I cannot use either of them to download any of the above modules.
More specifically fetching scikits.odes gives me this error log:
Cleaning up...
Removing temporary dir /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Exception information:
Traceback (most recent call last):
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1134, in prepare_files
req_to_install.run_egg_info()
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 259, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Similar error logs were thrown for the other module installation attempts I had made.
Any suggestions? How can I fix this obvious bug?
I suspect that by installing setuptools, you have corrupted the version of easy_install that is already included in in the distribute package, which is part of Canopy. I have updated this article to emphasize this caution.
Please delete your Canopy User Python directory, /Users/nick/Library/Enthought/Canopy_64bit/User/ and restart Canopy to re-create it without the conflicting version of setuptools. Then easy_install pip from terminal, and try again.
I am not sure if this will suffice, but it will be a step at least.