Skip to content

Install fails on macOS: "ModuleNotFoundError: No module named 'pip'" #22

Closed
@sertal70

Description

@sertal70

I'm trying to install eb cli on a macOS 10.14.4 but without success.

When I run the installation script directly using the command python ebcli_installer.py this is the output I get:


***********************************
1. Locating virtualenv installation
***********************************

******************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
Using base prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/Sergio/.ebcli-virtual-env/bin/python3.7
Also creating executable in /Users/Sergio/.ebcli-virtual-env/bin/python
Installing setuptools, pip, wheel...
done.

************************
3. Activating virtualenv
************************

*******************
4. Installing EBCLI
*******************
Traceback (most recent call last):
  File "/Users/Sergio/.ebcli-virtual-env/bin/pip", line 6, in <module>
    from pip._internal import main
ModuleNotFoundError: No module named 'pip'

***********************
5. Creating EB wrappers
***********************

***************
6. Finishing up
***************
Success!

    Note: To complete installation, ensure `eb` is in PATH. You can ensure this by executing:

    1. Bash:

       echo 'export PATH="/Users/Sergio/.ebcli-virtual-env/executables:$PATH"' >> ~/.bash_profile && source ~/.bash_profile

    2. Zsh:

       echo 'export PATH="/Users/Sergio/.ebcli-virtual-env/executables:$PATH"' >> ~/.zshenv && source ~/.zshenv

As you can see in step 4 there is an error on pip module which is correctly installed and working in the system:

$ pip --version
pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

Anyway, after installation script has completed, I tried to execute the EB CLI but I've got the following error:

$ eb
Traceback (most recent call last):
  File "/Users/Sergio/.ebcli-virtual-env/executables/eb", line 45, in <module>
    exit(_exec_cmd(['/Users/Sergio/.ebcli-virtual-env/bin/eb'] + sys.argv[1:]))
  File "/Users/Sergio/.ebcli-virtual-env/executables/eb", line 25, in _exec_cmd
    p = subprocess.Popen(args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/Sergio/.ebcli-virtual-env/bin/eb': '/Users/Sergio/.ebcli-virtual-env/bin/eb'

which I suppose is a consequence of the error occurred during installation.

I don't think it is a matter with my env or virtualenv because if I create manually a virtualenv everything goes fine:

$ virtualenv test
Using base prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/Sergio/Bidone/test-virtualend/test/bin/python3.7
Also creating executable in /Users/Sergio/Bidone/test-virtualend/test/bin/python
Installing setuptools, pip, wheel...
done.
$ source test/bin/activate
(test) $ python --version
Python 3.7.0
(test) $ pip --version
pip 19.1.1 from /Users/Sergio/Bidone/test-virtualend/test/lib/python3.7/site-packages/pip (python 3.7)

Any hint to sort out this issue would be very appreciated, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions