PyEZ: 'EntryPoint' object has no attribute 'resolve' - python

PyEZ user are facing issue with respect to subject line error
from jnpr.junos import Device
>>> dev = Device(host='xxx',user='xxxx',passwd='xxx')
>>> dev.open()
No handlers could be found for logger "ncclient.transport.ssh"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/jnpr/junos/device.py", line 483, in open
raise cnx_err
jnpr.junos.exception.ConnectError: ConnectError(host: esc-elit-01.dcbg.juniper.net, msg: 'EntryPoint' object has no attribute 'resolve')

Install cryptography 1.2.1 using below command
sudo pip install cryptography==1.2.1
or upgrade distribute
sudo pip install -U distribute
Ref:
https://github.com/mozilla/sops/issues/67
https://github.com/ARMmbed/yotta/issues/764

The "python-pip" package installs an old version of distribute/setuptools that is incompatible with versions of cryptography >= 1.3.
The cryptography library specifies a dependency on setuptools >= 11.3:
https://github.com/pyca/cryptography/blob/master/setup.py#L40
However, this requirement isn't getting met because setuptools has been installed by the OS's packaging system rather than by pip. When pip tries to upgrade setuptools, the upgrade fails (but doesn't cause the installation of cryptography to actually fail.)
Running:
sudo pip install -U distribute
Forces setuptools to be upgraded (the distribute package has been renamed to setuptools in later releases). You could also do:
sudo pip install -U setuptools

Related

while installing apex extension for pytorch(python environment) the following error is showing, am unable to solve this problem

I want to install apex extension for my pytorch environment, my system is windows 10 and am using python version 3.8.1 and pip version is 20.0.2
I read the instructions from this https://github.com/NVIDIA/apex and I executed the command
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext
This error is showing.
c:\users\dell\appdata\local\programs\python\python38\lib\site-packages\pip_internal\commands\install.py:244: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
cmdoptions.check_install_build_global(options)
Non-user install because site-packages writeable
Created temporary directory: C:\Users\Dell\AppData\Local\Temp\pip-ephem-wheel-cache-ehoqwpvf
Created temporary directory: C:\Users\Dell\AppData\Local\Temp\pip-req-tracker-uowlsjqi
Initialized build tracking at C:\Users\Dell\AppData\Local\Temp\pip-req-tracker-uowlsjqi
Created build tracker: C:\Users\Dell\AppData\Local\Temp\pip-req-tracker-uowlsjqi
Entered build tracker: C:\Users\Dell\AppData\Local\Temp\pip-req-tracker-uowlsjqi
Created temporary directory: C:\Users\Dell\AppData\Local\Temp\pip-install-rivnsaa9
Cleaning up...
Removed build tracker: 'C:\Users\Dell\AppData\Local\Temp\pip-req-tracker-uowlsjqi'
ERROR: You must give at least one requirement to install (see "pip help install")
Exception information:
Traceback (most recent call last):
File "c:\users\dell\appdata\local\programs\python\python38\lib\site-packages\pip_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
Please solve this problem
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext
The line specified in your link is
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
Note that you're missing the final ./, which is why pip tells you that
You must give at least one requirement to install (see "pip help install")
you're telling it to install, but you're not telling it what to install.

Issue with Installing Pillow for Python

I am trying to install Pillow in my RedHat operating system through pip
sudo pip install Pillow
However, I receive the following error
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.
Collecting Pillow
/usr/lib/python2.6/sitepackages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading Pillow-4.2.1.tar.gz (12.7MB)
100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 12.7MB 35kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-5XOfq_/Pillow/setup.py", line 143
required = {'jpeg', 'zlib'}
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5XOfq_/Pillow
How can I address this?
Thanks
The error you're getting has to do with the new syntax for creating sets that was introduced in Python 2.7.
{item1, item2, ...}
It seems you're running a version of Python prior to 2.7, which doesn't recognize this as valid syntax.
Pillow's web site includes notes on which versions of Pillow are compatible with which versions of Python. You'll need to either upgrade Python (recommended), or choose an older version of Pillow which works with the Python version you have.
http://prodiguer.github.io/synda/faq.html#transfer-module
here says:
This bug affects 3.6 version installed from source (RPM 3.6 and DEB
3.6 should not be affected). It has been fixed in 3.7. It can be fixed in 3.6 by downgrading the pypi pillow package:
pip install pillow==3.4.2

"AssertionError: Only python 2.7 and later is supported by ptyprocess", when installing pexpect via pip on python 2.6

I got following error when trying install pexpect via pip:
# pip install pexpect
Collecting pexpect
do_ypcall: clnt_call: RPC: Unable to receive; errno = Connection refused
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached pexpect-4.0.tar.gz
Collecting ptyprocess>=0.5 (from pexpect)
Using cached ptyprocess-0.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-2X4It7/ptyprocess/setup.py", line 10, in <module>
"Only python 2.7 and later is supported by ptyprocess.")
AssertionError: Only python 2.7 and later is supported by ptyprocess.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2X4It7/ptyprocess
It's pretty clear that downloaded ptyprocess works only with python 2.7, but doesn't pip should download correct packages versions, that are compatible with installed python versions?
My system info:
pip -V: pip 7.1.2 from /usr/lib/python2.6/site-packages (python 2.6)
python -V: Python 2.6.6
OS: CentOS 6.3
BTW: yum install pexpect succesfully installs pexpect package
Thank You
yum will install pexpect v2.3.6.
easy_install or pip will install pexpect v4.0.1 as of today.
You can use pexpect version 3.3 which not depends on ptyprocess version.
# easy_install pexpect==3.3
or
# pip install pexpect==3.3
AssertionError: Only python 2.7 and later is supported by ptyprocess.
pyexpect depends on ptyprocess>=0.5 (https://github.com/pexpect/pexpect/blob/master/setup.py#L66)
You will need to install a version of ptyprocess that is >=0.5 but works with python 2.6 first, then install pyexpect.
edit looks like you are out of luck, 0.5 requires python 2.7 (https://github.com/pexpect/ptyprocess/blob/master/setup.py#L9-L10). Your system package has it patched to work with 2.6 so you'll have to use that.

Latest 'pip' fails with "requires setuptools >= 0.8 for dist-info"

Using the recent (1.5) version of pip, I get an error when attempting to update several packages. For example, sudo pip install -U pytz results in failure with:
Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
I don't understand this message (I have setuptools 2.1) or what to do about it.
Exception information from the log for this error:
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 230, in run
finder = self._build_package_finder(options, index_urls, session)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 185, in _build_package_finder
session=session,
File "/Library/Python/2.7/site-packages/pip/index.py", line 50, in __init__
self.use_wheel = use_wheel
File "/Library/Python/2.7/site-packages/pip/index.py", line 89, in use_wheel
raise InstallationError("pip's wheel support requires setuptools >= 0.8 for dist-info support.")
InstallationError: pip's wheel support requires setuptools >= 0.8 for dist-info support.
This worked for me:
sudo pip install setuptools --no-use-wheel --upgrade
Note it's usage of sudo
UPDATE
On Windows you just need to execute pip install setuptools --no-use-wheel --upgrade as an administrator. In Unix/Linux, the sudo command is for elevating permissions.
UPDATE 2
This appears to have been fixed in 1.5.1.
First, you should never run 'sudo pip'.
If possible you should use your system package manager because it uses GPG signatures to ensure you're not running malicious code.
Otherwise, try upgrading setuptools:
easy_install -U setuptools
Alternatively, try:
pip install --user <somepackage>
This is of course for "global" packages. You should ideally be using virtualenvs.

hdf5 / h5py ImportError: libhdf5.so.7

I'm working on a project involving network messaging queues (msgpack, zmq, ...) on a RHEL 6.3 (x86_64) system. I was installing the most recent packages of glib, gevent, pygobject, pygtk, and such in order to get pylab / matplotlib to work (which hasn't been successful either).
After giving up I went back to my code and somehow I had managed to wreck my hdf5 / h5py installation - h5py can't find libhdf5.so.7 on import. I immediately reinstalled hdf5-1.8.9 in /usr/local/hdf5 on RHEL 6.3 (x86_64) as follows:
./configure --prefix=/usr/local/hdf5
make
make check
sudo make install
make check install
which seemed to work just fine. Then I went to reinstall h5py (in python 2.7.3):
python2.7 setup.py build --hdf5=/usr/local/hdf5/
python2.7 setup.py test # optional
# sudo python2.7 setup.py install
which fails to import the _errors file in the tests, like so:
======================================================================
ERROR: _hl.tests.test_attrs_data (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: _hl.tests.test_attrs_data
Traceback (most recent call last):
File "/usr/local/lib/python2.7/unittest/loader.py", line 252, in _find_tests
module = self._get_module_from_name(name)
File "/usr/local/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name
__import__(name)
File "/home/cronburg/Downloads/h5py-2.0.1/build/lib.linux-x86_64-2.7/h5py/_hl/tests/test_attrs_data.py", line 5, in <module>
import h5py
File "/home/cronburg/Downloads/h5py-2.0.1/build/lib.linux-x86_64-2.7/h5py/__init__.py", line 1, in <module>
from h5py import _errors
ImportError: libhdf5.so.7: cannot open shared object file: No such file or directory
----------------------------------------------------------------------
Ran 12 tests in 0.001s
FAILED (errors=12)
h5py was working fine before I went to install the aforementioned packages / tarballs, and I don't remember touching anything that even remotely looked like hdf5. Any ideas?
EDIT:
Trying to locate the file only shows it in the location i untarred it:
cronburg#rhel:~/Downloads/h5py-2.0.1$ locate libhdf5.so.7
/home/cronburg/tmp/hdf5-1.8.9/hdf5/lib/libhdf5.so.7
/home/cronburg/tmp/hdf5-1.8.9/hdf5/lib/libhdf5.so.7.0.3
/home/cronburg/tmp/hdf5-1.8.9/src/.libs/libhdf5.so.7
/home/cronburg/tmp/hdf5-1.8.9/src/.libs/libhdf5.so.7.0.3
take a look on:
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/libhdf5.so.7()(64bit)
Or should try this repo: https://ius.io/Packages/
I prefer always use the most updated python version, in a package format.
https://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/repoview/python27.html
sudo yum install -y https://centos6.iuscommunity.org/ius-release.rpm
sudo yum install -y python27
sudo yum install -y python27-devel
Do a pip install and be happy:
$ sudo pip install h5py
Installing collected packages: h5py
Successfully installed h5py-2.6.0
This also happened to me when using h5py on a clean raspbian. You need to install the system libraries first.
apt install libhdf5-dev
then
pip install h5py

Categories