How to install PyObjC on Python 3.5 (OS X 10.10 Yosemite)? - python

I am trying to install PyObjC using pip3 install pyobjc-core, on a Mac with Python 3.5 and OS X 10.10.5 (Yosemite). I get the following error message:
Collecting pyobjc-core
Downloading pyobjc-core-3.1.1.tar.gz (2.2MB)
100% |████████████████████████████████| 2.2MB 481kB/s
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 pip-egg-info/pyobjc_core.egg-info/PKG-INFO
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 namespace_packages to pip-egg-info/pyobjc_core.egg-info/namespace_packages.txt
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 "<string>", line 1, in <module>
File "/private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/setup.py", line 696, in <module>
**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/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/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/command/egg_info.py", line 180, in run
self.find_sources()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 207, in find_sources
mm.run()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 291, in run
self.add_defaults()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 320, in add_defaults
sdist.add_defaults(self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/sdist.py", line 130, in add_defaults
build_ext = self.get_finalized_command('build_ext')
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/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/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/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/
Similar, if I try just to do pip3 install pyobjc, I get a similar trackback, ending with these fatal words:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-432fq8a3/pyobjc-core/
Any hope for me, or is there, for instance, some known incompatibility with the system bundled version of Python?

I am a month late here but the first line of the error is:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
You need to install the full version of xcode from the app store not just the command line tools. :)

Related

Kubeflow Pipeline Installation with pip Fails with Error

I'm having hard times getting Kubeflow SDK installed with pip.
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ml-projects/housing-price-prediction-kfp$ pip install kfp --upgrade --user
Collecting kfp
Using cached kfp-1.8.12.tar.gz (301 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
running egg_info
creating /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info
writing /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/dependency_links.txt
writing entry points to /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/entry_points.txt
writing requirements to /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-llb4v9nb/kfp.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-bq6gjht_/kfp_42c911a696de4f64b51167638b3ce902/setup.py", line 154, in <module>
'kfp=kfp.__main__:main'
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 308, in run
self.find_sources()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 315, in find_sources
mm.run()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 550, in run
self.add_defaults()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 590, in add_defaults
rcfiles = list(walk_revctrl())
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools/command/sdist.py", line 18, in walk_revctrl
for item in ep.load()(dirname):
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/setuptools_scm/integration.py", line 70, in find_files
command = ep.load()
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2470, in load
self.require(*args, **kwargs)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2493, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages/pkg_resources/__init__.py", line 800, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyparsing 3.0.6 (/home/joesan/.pyenv/versions/3.7.8/lib/python3.7/site-packages), Requirement.parse('pyparsing<3,>=2.0.2'), {'packaging'})
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ml-projects/housing-price-prediction-kfp$ which python
/home/joesan/.pyenv/shims/python
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ml-projects/housing-price-prediction-kfp$ which pyenv
/opt/softwares/pyenv/bin/pyenv
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ml-projects/housing-price-prediction-kfp$
I was able to do it with pip3, but pip fails. Any thoughts on what is causing this nasty error?

Trying to install scikit-learn shows comman exit out with error status 1

I am trying to install the sklearn package and it does not work. I have numpy installed as well as scipy and have tried updating installing tools. I'm using Pycharm on Python 3.10. This is the error message that shows up
PS C:\Users\jason\PycharmProjects\pythonProject> pip install scikit-learn
Collecting scikit-learn
Using cached scikit-learn-1.0.1.tar.gz (6.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pe
p517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4'
cwd: C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80
Complete output (46 lines):
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 164, in prepare_metadata_for_build_w
heel
return hook(metadata_directory, config_settings)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 319, in <module>
setup_package()
File "setup.py", line 315, in setup_package
setup(**metadata)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "setup.py", line 201, in configuration
config.add_subpackage("sklearn")
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 982, in get_subpackage
config = self._get_configuration_from_setup_py(
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 924, in _get_configuration_from_setup
_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 85, in configuration
cythonize_extensions(top_path, config)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\__init__.py", line 47, in cythoniz
e_extensions
basic_check_build()
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 113, i
n basic_check_build
compile_test_program(code)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 70, in
compile_test_program
ccompiler.compile(
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 323, in compile
self.initialize()
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 220, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.c
om/visual-cpp-build-tools/
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/7c/596ff7b32f655f379d3abdfa82607e5cb3b70f46baad4604706511cfeb85/scikit-learn-1.0.1.tar.gz#sha256=ac2ca9
dbb754d61cfe1c83ba8483498ef951d29b93ec09d6f002847f210a99da (from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.7). Command errored out with exit status
1: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_p
rocess\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4' Check the logs for full command output.
I faced the same problem with having python 3.10.1 installed in my system (fedora35). This error occured both in my os and virtual environment. Later I installed python3.7 and from venv I could install scikit-learn.Try installing scikit-learn from different python version, which should work.
Same problem here.
noted that scilean only supported by python 2.7, 2.8 and 2.9.
so just downgrade python to 2.8 then reinstall scilearn.

How to make interactive maps with plain svg

First post and new programmer. I'm trying to make a small interactive map in python and javascript using the kartograph.org framework for python 2.7 but I came across a lot of problems that stop me in the first place.
1- I try to install the framework through
sudo pip install https://github.com/kartograph/kartograph.py/zipball/master -r https://raw.github.com/kartograph/kartograph.py/master/requirements.txt
but it gives me this error
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting https://github.com/kartograph/kartograph.py/zipball/master
Using cached https://github.com/kartograph/kartograph.py/zipball/master
Collecting GDAL
Using cached GDAL-3.1.0.tar.gz (592 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Jq7Uii/GDAL/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Jq7Uii/GDAL/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-6poFbM
cwd: /tmp/pip-install-Jq7Uii/GDAL/
Complete output (49 lines):
WARNING: numpy not available! Array support will not be enabled
running egg_info
creating /tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info
writing requirements to /tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info/requires.txt
writing /tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info/PKG-INFO
writing top-level names to /tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info/top_level.txt
writing dependency_links to /tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info/dependency_links.txt
writing manifest file '/tmp/pip-pip-egg-info-6poFbM/GDAL.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Jq7Uii/GDAL/setup.py", line 477, in <module>
setup(**setup_kwargs)
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
sdist.add_defaults(self)
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/home/roxas/.local/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pip-install-Jq7Uii/GDAL/setup.py", line 320, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/tmp/pip-install-Jq7Uii/GDAL/setup.py", line 263, in get_gdal_config
raise gdal_config_error(traceback_string + '\n' + msg)
__main__.gdal_config_error: Traceback (most recent call last):
File "/tmp/pip-install-Jq7Uii/GDAL/setup.py", line 257, in get_gdal_config
return fetch_config(option)
File "/tmp/pip-install-Jq7Uii/GDAL/setup.py", line 160, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
gdal_config_error: [Errno 2] No such file or directory
Could not find gdal-config. Make sure you have installed the GDAL native library and development headers.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried to install GDAL from
pip install GDAL
but keeps replying with the same error. I would be glad if someone helps me

How can I install GDAL in Ubuntu 16,04 with python 2.7.12 using pip?

I am trying to import some specific libraries using python. it should be easy like importing numpy for example like so:
import osgeo.gdal, gdal
from osgeo.gdalconst import *
But it seemed to me like the packages gdal and osgeo are missing so I went to the project interpreter to add these packages, Sadly i did not find the package osgeo and the package gdal could not be installed ... I looked it up in the net but it seems that there is no exact way to solve the matter.
I am using Ubuntu 16,04 with python 2.7.12 and PS GDAL is Geospatial Data Abstraction Library
This the error message that I am getting:
Collecting gdal
Using cached GDAL-2.2.3.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/GDAL.egg-info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging347/gdal/setup.py", line 339, in <module>
**extra )
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 180, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 207, in find_sources
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 291, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 320, in add_defaults
File "build/bdist.linux-x86_64/egg/setuptools/command/sdist.py", line 130, in add_defaults
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pycharm-packaging347/gdal/setup.py", line 214, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/tmp/pycharm-packaging347/gdal/setup.py", line 188, in get_gdal_config
return fetch_config(option)
File "/tmp/pycharm-packaging347/gdal/setup.py", line 141, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging347/gdal/
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Finally I found a solution to my problem.
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin
sudo apt-get -y install python-gdal
Thank you all for the contribution.

InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/

I'm trying to start a Pinax Project for Django.
I setup my Python Virtual Environment.
Upgraded setup tools.
Upgraded pip.
Installed Pinax.
Then when I tried 'pinax start blog my_site', it gave the following error:
Installing Django...
Traceback (most recent call last):
File "/usr/local/bin/pinax", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 63, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 97, in start
pip_install("Django")
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 23, in pip_install
command.run(opts, [package])
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/
I've tried making a python virtual environment inside my conda environment. Also tried making a standalone python environment. Neither solved it. Also tried installing django using pip.
Gave the following error:
sudo pip install django
The directory '/home/scarlet/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/scarlet/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting django
Downloading Django-2.0.tar.gz (8.0MB)
100% |████████████████████████████████| 8.0MB 62kB/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-SNP9W5/django/setup.py", line 32, in <module>
version = __import__('django').get_version()
File "django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "django/utils/version.py", line 61, in <module>
#functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SNP9W5/django/
What would you suggest?
Thank you for the read!
It appears like you are using python 2; if that is correct Django version 2 only supports python 3. Please refer to https://docs.djangoproject.com/en/2.0/releases/2.0/#python-compatibility
You could try installing a lower version of Django:
pip install "Django<2"
you may try:
pip3 install django

Categories

Resources