saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.02k stars 5.47k forks source link

'pip.installed' is not available #55247

Closed ksalman closed 4 years ago

ksalman commented 4 years ago

I installed a different version of python using pyenv.installed

2.7.15:
    pyenv.installed

and now I am trying to install its pip packages, but I am not able to target pip in that python location. I have tried using cwd option for pip.installed but that does not appear to work.

openstacksdk:
    pip.installed:
        - cwd: /usr/local/pyenv/versions/2.7.15/bin/

I also tried using the bin_env option, as shown here https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pip_state.html, but I get same result

openstacksdk:
    pip.installed:
        - bin_env: /usr/local/pyenv/versions/2.7.15/bin/pip
       ----------
                 ID: openstacksdk
           Function: pip.installed
             Result: False
            Comment: State 'pip.installed' was not found in SLS 'packages.python.2_7_15'
              Reason: 'pip.installed' is not available.
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8.1
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   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.13 (default, Feb 20 2019, 09:59:36)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.5.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: redhat 6.10 Carbon
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-43-generic
         system: Linux
        version: Scientific Linux 6.10 Carbon
xeacott commented 4 years ago

What is the package you are looking to install? Have you also written out the require as such:

          django:
            pip.installed:
              - name: django >= 1.6, <= 1.7
              - bin_env: /foo/.virtualenvs/bar
              - require:
                - pkg: python-pip
ksalman commented 4 years ago

Well, why would that be required though? python-pip package will install pip for a python that is in a different location and most likely a different version compared to what I have installed at the bin_env location, /usr/local/pyenv/versions/2.7.15/bin.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

ksalman commented 4 years ago

This is not stale.

On Tue, Jan 7, 2020, at 05:05, stale[bot] wrote:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/saltstack/salt/issues/55247?email_source=notifications&email_token=AAJVZB6ABKYH4SEU53ZGLA3Q4R42RA5CNFSM4JK7R3E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIIZLGA#issuecomment-571577752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVZBY2QT6XMXKKYGXJNWDQ4R42RANCNFSM4JK7R3EQ.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.

sagetherage commented 4 years ago

@Akm0d @xeacott can one of you please follow up here?

Akm0d commented 4 years ago

Does this PR address the issue? https://github.com/saltstack/salt/pull/56023

Akm0d commented 4 years ago

The referenced PR is a step towards a fix for this issue, let's remove the if salt.utils.platform.is_windows() and solve whatever issues pop up after that in a new PR

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

thoward27 commented 3 years ago

Was there any resolution for this issue? I am having trouble getting anything to install to a pyenv-installed version of python.

My goal is to install pyenv, then use that to install python3.8, then install pipx into that version of python. Any tips?

robsteneha commented 4 weeks ago

Hey is this issue resolved? I am also facing the same issue where python3-pip (system) is required to install anything using the virtual-env pip. bin_env also doesn't help in this case unless the pip is installed on system.