It always failed to pip install georasters in my macbook.
The following is the Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "build/bdist.macosx-10.12-intel/egg/setuptools/__init__.py", line 12, in <module>
File "build/bdist.macosx-10.12-intel/egg/setuptools/version.py", line 1, in <module>
File "build/bdist.macosx-10.12-intel/egg/pkg_resources/__init__.py", line 72, in <module>
File "build/bdist.macosx-10.12-intel/egg/packaging/requirements.py", line 59, in <module>
TypeError: __call__() takes exactly 2 arguments (1 given)
pip --version:
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)
After many times trying, I resolved the problem.
I used the command:pip install --no-deps georasters
https://pip.pypa.io/en/stable/reference/pip_install/#installation-order[enter image description here][1]
Related
I've been trying to install bs4 and selenium from the windows powershell, and here is the error message I get :
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\cli\base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\cli\req_command.py", line 247, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\commands\install.py", line 326, in run
session = self.get_default_session(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\cli\req_command.py", line 98, in get_default_session
self._session = self.enter_context(self._build_session(options))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\cli\req_command.py", line 125, in _build_session
session = PipSession(
^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\network\session.py", line 343, in __init__
self.headers["User-Agent"] = user_agent()
^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\network\session.py", line 175, in user_agent
setuptools_dist = get_default_environment().get_distribution("setuptools")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 188, in get_distribution
return next(matches, None)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 183, in <genexpr>
matches = (
^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\base.py", line 612, in iter_all_distributions
for dist in self._iter_distributions():
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 176, in _iter_distributions
for dist in finder.find_eggs(location):
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 146, in find_eggs
yield from self._find_eggs_in_zip(location)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 123, in _find_eggs_in_zip
from pip._vendor.pkg_resources import find_eggs_in_zip
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3251, in <module>
#_call_aside
^^^^^^^^^^^
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3277, in _initialize_master_working_set
tuple(
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3278, in <genexpr>
dist.activate(replace=False)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2785, in activate
declare_namespace(pkg)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2284, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2217, in _handle_ns
loader.load_module(packageName)
File "C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygoogle\google.py", line 113
print """PyGoogle %(__version__)s
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
I cannot install any pip package in my pc it returns that error
pip version is : pip 22.3.1
python version is : Python 3.11.1
Appreciate Your support .
I tried to install any pip package
You've installed a package PyGoogle which is very old (2006) and works only with Python 2. You need to uninstall it:
pip uninstall -y pygoogle
If that doesn't work — remove the directory C:\Users\T470\AppData\Local\Programs\Python\Python311\Lib\site-packages\pygoogle
~ $ pip install gevent
Collecting gevent
Using cached gevent-21.12.0.tar.gz (6.2 MB)
Installing build dependencies ... done Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting zope.event
Using cached zope.event-4.5.0-py2.py3-none-any.whl (6.8 kB)
Requirement already satisfied: setuptools in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from gevent) (58.1.0)
Collecting zope.interface
Using cached zope.interface-5.4.0-cp310-cp310-linux_aarch64.whl
Requirement already satisfied: greenlet<2.0,>=1.1.0 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from gevent) (1.1.2)
Building wheels for collected packages: gevent
Building wheel for gevent (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for gevent (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
generating cffi module 'build/temp.linux-aarch64-3.10/gevent.libuv._corecffi.c'
Running '(cd
"/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/deps/libev" && sh ./configure -C
configure-output.txt )' in /data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a
configure: error: no acceptable ld found in $PATH
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 481, in <module>
run_setup(EXT_MODULES)
File "setup.py", line 348, in run_setup
setup(
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 143, in run
ext.sources[0] = make_mod(self.build_temp, pre_run)
File "/data/data/com.termux/files/usr/tmp/pip-build-env-l1wl_veu/overlay/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 128, in make_mod
pre_run(ext, ffi)
File "/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/_setuputils.py", line 364, in pre_run
action()
File "/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/_setuplibev.py", line 55, in configure_libev
system(libev_configure_command)
File "/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/_setuputils.py", line 195, in system
if _system(cmd, cwd=cwd, env=env, **kwargs):
File "/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/_setuputils.py", line 191, in _system
return check_call(cmd, cwd=cwd, env=env, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '(cd "/data/data/com.termux/files/usr/tmp/pip-install-55j041qz/gevent_018671f4e2174ad19170736008c5782a/deps/libev" && sh ./configure -C > configure-output.txt )' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gevent
Failed to build gevent
ERROR: Could not build wheels for gevent, which is required to install pyproject.toml-based projects
~ $
try lower versions
https://pypi.org/project/gevent/#history
I have tried all the versions I see 20.4.0 Is the best
Try:
pkg install binutils
This worked for me.
Did any one face this issue while downloading the latest Anaconda3 and opened spyder?
An error ocurred while starting the kernel
The error is:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole\plugin.py", line 1173, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle, **kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\manager.py", line 301, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\manager.py", line 248, in pre_start_kernel
self.write_connection_file()
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 474, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application.
Any help will be appreciated !!
I just did a fresh install of python3 (3.6.5_1) on Mac OS (High Sierra) and pip3 does not work. I get the following error with pip3:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
return self.resolve()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
File "/usr/local/lib/python3.6/site-packages/pip/_internal/index.py", line 39, in <module>
from pip._internal.wheel import Wheel, wheel_ext
File "/usr/local/lib/python3.6/site-packages/pip/_internal/wheel.py", line 7, in <module>
import compileall
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/compileall.py", line 20, in <module>
from concurrent.futures import ProcessPoolExecutor
File "/Library/Python/2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/Library/Python/2.7/site-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
which pip3 returns /usr/local/bin/pip3
I have searched and can't find a solution.
I'm trying to install pylint with pip install pylint
But i've got this at the end of installation:
Removing temporary dir c:\users\fixxxer\appdata\local\temp\pip_build_Fixxxer...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "C:\Python27\lib\site-packages\pip\req.py", line 292, in run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
File "C:\Python27\lib\site-packages\pip\req.py", line 265, in setup_py
import setuptools
File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 12, in <module>
from setuptools.extension import Extension
File "C:\Python27\lib\site-packages\setuptools\extension.py", line 7, in <module>
from setuptools.dist import _get_unpatched
File "C:\Python27\lib\site-packages\setuptools\dist.py", line 16, in <module>
from setuptools.depends import Require
File "C:\Python27\lib\site-packages\setuptools\depends.py", line 6, in <module>
from setuptools import compat
File "C:\Python27\lib\site-packages\setuptools\compat.py", line 19, in <module>
from SimpleHTTPServer import SimpleHTTPRequestHandler
File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "C:\Python27\lib\SimpleHTTPServer.py", line 204, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Python27\lib\mimetypes.py", line 355, in init
db.read_windows_registry()
File "C:\Python27\lib\mimetypes.py", line 259, in read_windows_registry
for ctype in enum_types(mimedb):
File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)
Any ideas how can i fix this or some workarounds?
How can i install it manually?
UPDATE.
replacing
default_encoding = sys.getdefaultencoding()
with
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
default_encoding = sys.getdefaultencoding()
does this:
Cleaning up...
Removing temporary dir c:\users\fixxxer\appdata\local\temp\pip_build_Fixxxer...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "C:\Python27\lib\site-packages\pip\req.py", line 292, in run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
File "C:\Python27\lib\site-packages\pip\req.py", line 265, in setup_py
import setuptools
File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 12, in <module>
from setuptools.extension import Extension
File "C:\Python27\lib\site-packages\setuptools\extension.py", line 7, in <module>
from setuptools.dist import _get_unpatched
File "C:\Python27\lib\site-packages\setuptools\dist.py", line 16, in <module>
from setuptools.depends import Require
File "C:\Python27\lib\site-packages\setuptools\depends.py", line 6, in <module>
from setuptools import compat
File "C:\Python27\lib\site-packages\setuptools\compat.py", line 19, in <module>
from SimpleHTTPServer import SimpleHTTPRequestHandler
File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "C:\Python27\lib\SimpleHTTPServer.py", line 204, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Python27\lib\mimetypes.py", line 359, in init
db.read_windows_registry()
File "C:\Python27\lib\mimetypes.py", line 263, in read_windows_registry
for ctype in enum_types(mimedb):
File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'gbk' codec can't decode bytes in position 4-5: illegal multibyte sequence
Found a problem.
There was a few MIME types with Cyrillic names in
HKEY_CLASSES_ROOT\MIME\Database\Content Type
Removed them and problem was solved.
I had the same error and this helped me https://stackoverflow.com/a/23278373/2571607
Basically, open C:\Python27\Lib\mimetypes.py
replace
‘default_encoding = sys.getdefaultencoding()’
with
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
default_encoding = sys.getdefaultencoding()