Errors when running python3-pip from Salt

697 views
Skip to first unread message

monosij...@gmail.com

unread,
Apr 13, 2014, 2:24:29 PM4/13/14
to salt-...@googlegroups.com

Hello -

I have been working with Salt from Vagrant and have a configuration that installs Python3 packages from using pip.

I am running on the latest version of Ubuntu 14.04 server and latest version of Vagrant 1.5.2 with the latest version of Oracle VirtualBox 4.3.10 as well.

The sls is as follows - thankfully borrowed from folks who posted online:
..................................................................
..................................................................
pip3-dependencies:
  pkg.installed:
    - names:
      - python3-dev
      - build-essential
      - python3-pip

python3-pip:
  pkg.installed

mysql-connector-python:
  pip.installed:
    - require:
      - pkg: pip3-dependencies

psycopg2:
  pip.installed:
    - require:
      - pkg: pip3-dependencies

pyzmq:
  pip.installed:
    - require:
      - pkg: pip3-dependencies
..................................................................
..................................................................
I keep getting:
----------
        ID: mysql-connector-python
    Function: pip.installed
      Result: False
     Comment: State pip.installed found in sls python3 is unavailable
     Changes:   

----------
          ID: psycopg2
    Function: pip.installed
      Result: False
     Comment: State pip.installed found in sls python3 is unavailable
     Changes:   
..................................................................
..................................................................

Wondering what I may be doing wrong? The pip3-dependencies including python3-pip install fine.

I wonder if this may have anything to being at latest version of Python at 3.4?

I have noticed that I while I can go in and run 'sudo pip3 install psycopg2' - I cannot do the same for mysql-connector-python.
For mysql-connector I have to run 'sudo pip3 install --allow-all-external mysql-connector-python'.
I do not have to do an --allow-all-external when in Python 3.3 in my development box.

Would that be because pip3 is not properly setup for Python 3.4 OR
my configuration is incorrect for pip3 install.

I am running on the latest version of Ubuntu 14.04 server and latest version of Vagrant 1.5.2 with the latest version of Oracle VirtualBox 4.3.10 as well.

Thank you for your help.

Mono

Colton Myers

unread,
Apr 29, 2014, 5:13:56 PM4/29/14
to salt-...@googlegroups.com
I think the problem here is that the pip state looks for a pip accessible to the Python which is running Salt.  It actually tries to `import pip` to make sure pip is available.  It does not currently support managing a pip which is separate from the Python which is running Salt.  You're welcome to file a feature request on Github, however.

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monosij Dutta-Roy

unread,
May 8, 2014, 9:51:39 PM5/8/14
to salt-...@googlegroups.com, colton...@gmail.com
Hello Colton -

Don't understand your reply. The pip is part of the same python - just need to run pip3 install.

pip gets installed fine. Would that not be a problem if it could not resolve the environment?

These commands run fine:

pip3-dependencies:
  pkg.installed:
    - names:
      - python3-dev
      - build-essential
      - python3-pip

python3-pip:
  pkg.installed

------

Do you think it has something to do with python 3.4 which is what it is installing in Ubuntu 14.04?

Thanks.

Monosij


--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/RlRe7mZgqpc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.

Pedro Algarvio

unread,
May 9, 2014, 9:10:09 AM5/9/14
to salt-...@googlegroups.com
On 09/05/14 02:51, Monosij Dutta-Roy wrote:
Hello Colton -

Don't understand your reply. The pip is part of the same python - just need to run pip3 install.

pip gets installed fine. Would that not be a problem if it could not resolve the environment?


Hello.

Salt, which runs on Py2, not Py3(yet), needs and importable pip package installed.
So, before Salt can work with your pip3 states, it needs pip2 installed.

pip2 will not be used with your states because you're specifying the proper pip3 binary, if you're not, you should or the one found in PATH will be used.

Clearer?

Best,
--
Pedro Algarvio Pedro Algarvio
Email me @algarvio.me // Find me on LinkedIn // Find me on Twitter // Find me on GitHub // Find me on BitBucket // Find me on Ohloh // Like my work? Tip me on GitTip

Monosij Dutta-Roy

unread,
May 9, 2014, 2:16:37 PM5/9/14
to salt-...@googlegroups.com
Ok so if I do a pip2 installed - this should work?

Or will it not work regardless as Salt uses Py2 and not Py3?

When is Salt going to Py3 - if there is a way to use a Beta version of Salt on Py3, especially from within Vagrant, would be great to know.

Thanks.

Mono




--

Colton Myers

unread,
May 13, 2014, 7:09:10 PM5/13/14
to salt-...@googlegroups.com
We're moving in that direction, but it will still be some time.  I would not expect it to support Py3 this year.

That said, it should work if you get the python2 version of pip installed.  Then you can install packages with it.

You can also use `cmd.run` to manually run pip3 commands:

install-my-python-package:
  cmd.run:
    - name: pip3 install mypackage

Hope that helps.

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.

Monosij Dutta-Roy

unread,
May 14, 2014, 1:36:29 PM5/14/14
to salt-...@googlegroups.com
Thanks Colton. I will try cmd.run. I should have found this directive though.

However I don't understand this line:

'That said, it should work if you get the python2 version of pip installed.  Then you can install packages with it.'

pip2 cannot install Python3 packages - if that's what you mean?

Thanks again.

Mono
Reply all
Reply to author
Forward
0 new messages