I'm still a novice to all the advanced parts of coding. i have the 3.9.11 version of python installed. Whenever i install Pygames, I always get this result below. Any way that i could resolve this? thanks!
C:\\Users\\username\>pip install pygame==2.0.0.dev14
Collecting pygame==2.0.0.dev14
Downloading https://files.pythonhosted.org/packages/4e/f6/9031970fbd0cabb02842a68b6bd2defc55f4c1409e76712dd32c4d6e46cf/pygame-2.0.0.dev14.tar.gz (5.6MB)
100% |################################| 5.6MB 74kB/s
c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages_distutils_hack\__init_\_.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
"Distutils was imported before Setuptools, but importing Setuptools "
c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages_distutils_hack\__init_\_.py:30: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Exception:
Traceback (most recent call last):
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\commands\\install.py", line 294, in run
requirement_set.prepare_files(finder)
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_set.py", line 334, in prepare_files
functools.partial(self.\_prepare_file, finder))
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_set.py", line 321, in \_walk_req_to_install
more_reqs = handler(req_to_install)
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_set.py", line 505, in _prepare_file_
abstract_dist.prep_for_dist()
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_set.py", line 123, in prep_for_dist
self.req_to_install.run_egg_info()
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_install.py", line 376, in run_egg_info
self.setup_py, self.name,
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pip\\req\\req_install.py", line 347, in setup_py
import setuptools # noqa
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\setuptools\__init_.py", line 8, in \<module\>
import _distutils_hack.override # noqa: F401_
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages_distutils_hack\\override.py", line 1, in \<module\>
__import__('_distutils_hack').do_override()_
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages_distutils_hack\__init_.py", line 72, in do_override
ensure_local_distutils()
File "c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\site-packages_distutils_hack\__init_.py", line 59, in ensure_local_distutils
assert '\_distutils' in core.__file__, core.__file__
AssertionError: c:\\users\\username\\appdata\\local\\programs\\python\\python35\\lib\\distutils\\core.py
You are using pip version 7.1.2, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
First things first, upgrade your pip putting this in your cmd: python -m pip install --upgrade pip. Why are you installing lower version of pygame? Also if you don't have a specific reason to use python 3.9, you can install python 3.10. If that doesn't work, try reinstalling python so it reinstalls the pip and then try again.
Related
Im using python 2.7 and trying to install jsonschema package but its throwing me following error
I tried to upgrade the pip with command
pip install --upgrade pip
Also tried with command pip install jsonschema --no-use-pep517. But still no luck.
pip install jsonschema
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 pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting jsonschema
Using cached jsonschema-4.0.0.tar.gz (290 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
return func(self, options, args)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 321, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 180, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 385, in _resolve_one
dist = self._get_dist_for(req_to_install)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 337, in _get_dist_for
dist = self.preparer.prepare_linked_requirement(req)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 524, in _prepare_linked_requirement
req, self.req_tracker, self.finder, self.build_isolation,
File "/usr/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 88, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py", line 39, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py", line 97, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 178, in get_requires_for_build_wheel
'config_settings': config_settings
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 284, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
BackendUnavailable
jsonschema 3.2.0 and perhaps any version less than 4.0 support Python 2.7. Try
pip install "jsonschema<4.0"
Your Python package is 2.7 . Pip has stopped support this version. You need to upgrade your python version and then you should try this.
pip install jsonschema
problem: I can't run "tensorboard --logdir=summaries" in my terminal because I get this error
system: macbook pro running Catalina
environment: running pyenv with python3 as global
package: I have tensorflow 2.2.0 installed via pip
I have setuptools 49.1.0
Traceback (most recent call last):
File "/usr/local/bin/tensorboard", line 10, in
sys.exit(run_main())
File "/Library/Python/3.7/site-packages/tensorboard/main.py", line 65, in run_main
default.get_plugins() + default.get_dynamic_plugins(),
File "/Library/Python/3.7/site-packages/tensorboard/default.py", line 125, in get_dynamic_plugins
"tensorboard_plugins"
File "/Library/Python/3.7/site-packages/tensorboard/default.py", line 124, in
for entry_point in pkg_resources.iter_entry_points(
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 2410, in load
self.require(*args, **kwargs)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 2433, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (setuptools 40.8.0 (/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages), Requirement.parse('setuptools>=41.0.0'))
the setuptools version you have is 40.8.0.
tensorboard needs setuptools>=41.0.0.
So there are two solutions:
update setuptools to >=41.0.0
create a new environment with setuptools>=41.0.0.
MacOs may not allow you to update setuptools, due to system integrity protection
Adding --user python to the command allowed this to work.
In other words
pip install --upgrade setuptools --user python
As it turns out I was not using Pyenv correctly. Once I used "pyenv global system" then I was able to update the pip packages correctly and the right setuptools was installed and TensorBoard ran as expected
When is try to install scikit learn, im getting this error,
I used "pip install -U scikit-learn[alldeps]"
"""Collecting scikit-learn[alldeps]
Using cached scikit_learn-0.18.1-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already up-to-date: numpy>=1.6.1; extra == "alldeps" in /usr/local/lib/python2.7/dist-packages (from scikit-learn[alldeps])
Collecting scipy>=0.9; extra == "alldeps" (from scikit-learn[alldeps])
Using cached scipy-0.19.0-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: scipy, scikit-learn
Found existing installation: scipy 0.17.0
DEPRECATION: Uninstalling a distutils installed project (scipy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling scipy-0.17.0:
Exception:
Traceback (most recent call last):
File "/home/suba/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/suba/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/suba/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/home/suba/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/home/suba/.local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/home/suba/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/scipy-0.17.0.egg-info' """
How can i fix this error?
Permission error.
sudo pip install -U scikit-learn[alldeps] could help.
There's a permission error. Are you using root permissions to install? If not, please use same command prefixed with 'sudo' and provide password when asked.
I'm trying to upgrade the numpy library on macOS, but pip doesn't seem to have sufficient permissions to delete numpy. Running `pip install --upgrade pip gives me this traceback:
➜ Desktop sudo -H pip install --upgrade numpy
Collecting numpy
Using cached numpy-1.11.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: numpy
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
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 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-21oX9d-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
So apparently pip is having trouble deleting /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info. Trying to delete this file manually in finder gives me this error:
“numpy-1.8.0rc1-py2.7.egg-info” can’t be modified or deleted because it’s required by OS X.
How can I solve this? (Using the builtin numpy isn't an option because tensorflow, a package I need, needs the newest version).
Was facing the same issue
sudo pip install --ignore-installed numpy
For me on macOS High Sierra the below worked well:
sudo pip install --ignore-installed numpy
I have already installed homebrew and pip. When I run $pip install praw the following comes up:
dhcp-215-185:~ my_name$ pip install praw
Downloading/unpacking praw
Downloading praw-2.1.16-py2.py3-none-any.whl (70kB): 70kB downloaded
Downloading/unpacking update-checker>=0.10 (from praw)
Downloading update_checker-0.10-py2.py3-none-any.whl
Downloading/unpacking requests>=1.2.0 (from praw)
Downloading requests-2.2.1-py2.py3-none-any.whl (625kB): 625kB downloaded
Downloading/unpacking six>=1.4 (from praw)
Downloading six-1.6.1-py2.py3-none-any.whl
Installing collected packages: praw, update-checker, requests, six
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.5-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.5-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.5-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.5-py2.7.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-1.5.5-py2.7.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.7/site-packages/pip-1.5.5-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-1.5.5-py2.7.egg/pip/wheel.py", line 205, in clobber
os.makedirs(destdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/praw'
Storing debug log for failure in /Users/my_name/Library/Logs/pip.log
dhcp-215-185:~ my_name$
Does anyone have a fix? Installing this has been a real headache. Thanks a lot!
A quick workaround would be to use the sudo pip install praw command to intall praw as a super-user. However, this is not recommended, as it can cause problems later on with things such as updates and scaling your application upwards. One would instead suggest that you create a virtual environment, and pip install praw inside it.
If you are confident that the application you are building will not grow too large, it is probably ok to install praw using sudo.
I was getting the same error as you and I found an answer in the reddit documentation for PRAW. I used HomeBrew to install pip and I'm using Python 3.x instead of the 2.7x that's shipped with OSX, which means I needed to use pip3 instead of pip. It worked right away.
I hope this helps!