-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
salt pip AttributeError: type object 'InstallRequirement' has no attribute 'from_line' #49967
Comments
looks like i'm able to replicate this. we will need to get this fixed up. thanks |
I just hit the same error: Dependency Versions: System Versions: Error occurs in /usr/lib/python2.7/dist-packages/salt/states/pip_state.py at line 134 ("install_req = InstallRequirement.from_line(pkg)") because InstallRequirement does not have a from_line method any longer. I don't have enough experience with saltstack and pip to figure out how to fix it. |
@gtmanfred I've assigned this one to your for 2018.3.4 :) |
i have de some error when i use module.pip for install pyinotify:
|
Yup that is what this issue is about, it will be fixed for 2018.3.4, in the mean run downgrade pip to less than 18.1 |
Okay, no problem, I'm still using it in the lab, it was just reporting the problem. |
I'm seeing this too after upgrading from
versions
|
The salt version upgrade doesn't matter here, pip version 18.1 made some
changes that broke the way we used it. downgrade pip and this will work
again.
…On Thu, Oct 18, 2018 at 10:44 PM LSH ***@***.***> wrote:
I'm seeing this too after upgrading from 2017.7.5 to 2017.7.7 in order to
fix this bug: #46163 <#46163>
----------
ID: global-python-requisites
Function: pip.installed
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1879, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1826, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 682, in installed
out = _check_pkg_version_format(pkg)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 149, in _check_pkg_version_format
install_req = InstallRequirement.from_line(pkg)
AttributeError: type object 'InstallRequirement' has no attribute 'from_line'
Started: 03:38:45.261020
Duration: 431.364 ms
Changes:
versions
# salt-call --versions
Salt Version:
Salt: 2017.7.7
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: UTF-8
machine: x86_64
release: 4.4.0-1030-aws
system: Linux
version: Ubuntu 16.04 xenial
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49967 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAssoWYCX_THx4AMND3pPzUCSTxuhaBBks5umUqZgaJpZM4XU875>
.
|
This is fixed with #50280 |
How can I install an older version of install python-pip:
pkg.installed:
- name: python-pip
- version: 9.0.3
install python lib for docker:
pip.installed:
- name: docker == 3.6.0
- require:
- pkg: install python-pip And still get the error. But also, I don't know what version of |
can you verify its actually installing 9.0.3 when you run that state?Also if you run it a second time do you still see the error? |
@Ch3LL actually, I run it with the |
I see that this issue got fixed in 2018.3.4 (#50280) but I still get it with that version. |
How are you installing 2018.3.4, because that hasn't been released yet. |
Can I get a ball-park idea of when to expect |
I am so sorry, I just added the version in my kitchen.yml and I somehow missed the error that the version does not exist. |
you can check #releases on the salt community slack listed on the community page of saltstack.com https://saltstackcommunity.herokuapp.com but @saltstack/team-triage might know a date. I know right now they are working on getting an RC out for fluorine. |
if you have to use pip 18.1 right now, you can always drop the pip.py module into salt://_modules like all other dynamic modules. https://docs.saltstack.com/en/latest/ref/file_server/dynamic-modules.html |
OK, I don't need pip |
did you try pip 10.x? |
Oh hey, good idea. Just tried it, unfortunately python still won't install. All I'm getting is: ----------
ID: python-3.7.0
Function: pyenv.installed
Result: False
Comment: Could not install python.
Started: 13:21:55.953496
Duration: 1069.615 ms
Changes: This doesn't occur with pip 18.1, instead I get the known |
Description of Issue/Question
after pip upgrade on ubuntu 14.04 to 9.8 -> 18.1 salt state pip.install failing with
AttributeError: type object 'InstallRequirement' has no attribute 'from_line'
To make the state work again uninstall new pip version
$ sudo pip uninstall pip
$ sudo apt install --reinstall python-pip
$ sudo pip install pip==9.0.1
#Note now the sls state pip.install below works
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
#sls file
docker:
pip.installed:
- name: docker
- reload_modules: True
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
##Ubuntu 14.04
sudo pip install --upgrade pip
pip --version
vagrant@localsandbox:~$ pip --version
/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)vagrant@localsandbox:~$ salt-call --versions-report
/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Salt Version:
Salt: 2018.3.2
Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: 3.5.0
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 0.9.1
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.2.3
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.6 (default, Nov 23 2017, 15:49:48)
python-gnupg: 0.4.3
PyYAML: 3.10
PyZMQ: 14.0.1
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist: Ubuntu 14.04 trusty
locale: UTF-8
machine: x86_64
release: 4.4.0-137-generic
system: Linux
version: Ubuntu 14.04 trusty
vagrant@localsandbox:~$
The text was updated successfully, but these errors were encountered: