when running virtualenv command on terminal - python-3.x

Thank you for your time.
I installed virtualenv on my mac using pip, but when I ran virtualenv env, it showed an error:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 6, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3241, in
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 583, in _build_master
ws.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'importlib-resources>=1.0' distribution was not found and is required by virtualenv
Please help. I installed the latest packaghes of importlib but it still doesn't work.

Your stack shows 2.7 python.
your tag question as python-3.x
You indicated that you already have importlib.
But error is about importlib-resources.
Try to import importlib_resources:
importlib_resources is a backport of Python 3.9’s standard library importlib.resources module for Python 2.7, and 3.5 through 3.8. Users of Python 3.9 and beyond are encouraged to use the standard library module. Developers looking for detailed API descriptions should refer to the Python 3.9 standard library documentation.

Related

aws git-remote-codecommit operation error (GRC)

I hit this error when using git with a remote codecommit repo using GRC protocol.
git fetch
Traceback (most recent call last):
File "/home/meh/.local/bin/git-remote-codecommit", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3095, in <module>
#_call_aside
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 570, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jmespath<2.0.0,>=0.7.1' distribution was not found and is required by botocore
Answering my own question in case other hit this issue.
I'm using oracle linux 8 install atm, and installed python3 and and awscli + boto from an rpm.
for me the fix was to install jmespath from yum. It's not obvious at first but this is part of the python package family. to fix the issue you need to install the additional python3-jmespath package.
Example:
sudo yum install python3-jmespath.noarch

openslide python import show:windows error

I am using python 2.7 win 32
I need to install openslide in python
in below page show
Install openslide
http://openslide.org/download/
which item download for windows.
i tried every thing.and pip installation
the error shows below
import openslide
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import openslide
File "C:\Python27\lib\site-packages\openslide\__init__.py", line 29, in >>>> <module>
from openslide import lowlevel
File "C:\Python27\lib\site-packages\openslide\lowlevel.py", line 41, in <module>
_lib = cdll.LoadLibrary('libopenslide-0.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Thanks
This question may be old, but perhaps an answer will help a future viewer.
To fix this error, you need to download the openslide binaries at http://openslide.org/download/ look under (Windows Binaries)
Next, add the location of the bin folder to your system path (this will allow python to know where the module is). And that should solve the problem.
Install instructions found here: https://pypi.python.org/pypi/openslide-python

Unable to Install Tensorflow with Python 3 on Ubuntu 12.04 LTS

I have already have a virtual environment installation of Tensorflow on my computer, although it runs Python 2.7. Now I want to work with Tensorflow running in Python 3.5.
For Python 3, I've created a virtual environment since the default Python environment on my computer is Python 2.7. I'm attempting a Pip installation of Tensorflow in a Python 3 virtual environment that I have named py3k. The installation procedure throws errors that I'm finding difficulty in debugging.
Here's what I did:
anirudh#anirudh-Vostro-3445:~$ source activate py3k
(py3k) anirudh#anirudh-Vostro-3445:~$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
(py3k) anirudh#anirudh-Vostro-3445:~$ sudo pip3 install --upgrade $TF_BINARY_URL
/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/_vendor/pkg_resources/__init__.py:80: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 9, in <module>
load_entry_point('pip==8.1.2', 'console_scripts', 'pip3')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/download.py", line 36, in <module>
from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner
File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/utils/ui.py", line 15, in <module>
from pip._vendor.progress.bar import Bar, IncrementalBar
File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/_vendor/progress/bar.py", line 48
empty_fill = u'∙'
^
SyntaxError: invalid syntax
cp35 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl means C python 3.5
You have python 3.2 on your machine
I recommend installing Ubuntu 15.04

Jython ImportError: No module named urllib

Just installed Jython 2.7beta3 and pip under Jython in mac os x
try to run /usr/local/Cellar/jython/2.7-b3/libexec/bin/pip install requests
Get error:
Traceback (most recent call last):
File "./pip", line 8, in <module>
sys.exit(
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py", line 519, in load_entry_point
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py", line 2630, in load_entry_point
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py", line 2310, in load
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py", line 2316, in resolve
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/pip-6.0.6-py2.7.egg/pip/__init__.py", line 15, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/Cellar/jython/2.7-b3/libexec/Lib/site-packages/pip-6.0.6-py2.7.egg/pip/vcs/__init__.py", line 8, in <module>
from pip._vendor.six.moves.urllib import parse as urllib_parse
ImportError: No module named urllib
I found I can't install anything by pip under jython.
Please help me fix it, thanks.
I had the same problem trying to use pip for Jython2.7b3.
I downloaded this:
https://github.com/jythontools/pip/tree/master
And ran the command:
Jython setup.py install
And pip is now up and running like a charm.

Building PySide 1.2.0: no pyside-uic

I compiled PySide 1.2.0 for python 3.3 on my machine (Ubuntu 13.04 x64), but, for some reason, pyside-tools don't get "compiled".
When I try to execute pyside-uic (after install) I get this error:
Traceback (most recent call last):
File "/usr/local/bin/pyside-uic", line 9, in <module>
load_entry_point('PySide==1.2.0', 'console_scripts', 'pyside-uic')()
File "/usr/local/lib/python3.3/dist-packages/distribute-0.6.49-py3.3.egg/pkg_resources.py", line 345, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/dist-packages/distribute-0.6.49-py3.3.egg/pkg_resources.py", line 2382, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.3/dist-packages/distribute-0.6.49-py3.3.egg/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python3.3/dist-packages/PySide-1.2.0-py3.3.egg/PySide/scripts/uic.py", line 28, in <module>
from pysideuic.driver import Driver
ImportError: No module named 'pysideuic'
The egg file doesn't have the pysideuic folder. And when I check the pyside_install/py3.3-qt4.8.4-64bit-release/lib folder, I found that a "python2.7" folder exist!!
I build the sources using the instructions from this page: https://pypi.python.org/pypi/PySide.
Please, help.
It should be fixed now. Please get latest version of pyside-setup from github [1] and rebuild pyside distribution. Let me know if you have any issues.
[1] https://github.com/PySide/pyside-setup
Try to find the pyside-uic.exe or uic.exe in python folder/scripts and copy it in the required directory. or if not found any script in the particular directory, then reinstall PySide and check for any logs that say where pyside UIC is installed. Because I have also used python 2.x and I have personally experienced this problem. Check out for the scripts subfolder in python installation directory

Resources