Skip to content
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

pip import error: cannot import name main after installing pipenv #5678

Closed
jcbridwe opened this issue Jul 30, 2018 · 4 comments
Closed

pip import error: cannot import name main after installing pipenv #5678

jcbridwe opened this issue Jul 30, 2018 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@jcbridwe
Copy link

jcbridwe commented Jul 30, 2018

Environment

  • pip version:2.7
  • Python version: 2.7
  • OS: Windows 10

Description

I am trying to use pipenv as well as pip and having some issues. I installed pipenv using pip. I installed pipenv using pip. Then I went back and tried to run pip -v and got the following: ImportError: cannot import name main. I have seen this question answered for Linux and Mac, but I cannot use sudo or which commands; I am on Windows 10 using the CMD console. In my scripts folder, I see pip, pip2.7, and pip2. I cannot remember which one was my system pip. I know I need to maybe uninstall and reinstall (I have already tried to upgrade, but of course, without pip running you can't upgrade pip). I don't want to make more of a mess, so I wanted to ask how to resolve this in the CMD console on Windows.

Expected behavior

$pip -v #should return version

How to Reproduce

$pip install --user pipenv

  1. Get package from '...'
  2. Then run '$pip -v'
  3. An error occurs.
    ImportError: cannot import name main.

Output

$pip install --user pipenv
$pip -v

Traceback (most recent call last):
  File "c:\python27\arcgis10.5\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\arcgis10.5\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\ArcGIS10.5\Scripts\pip.exe\__main__.py", line 5, in <module>
ImportError: cannot import name main

@benoit-pierre
Copy link
Member

Try using python -m pip instead, to upgrade/reinstall pip.

@pradyunsg
Copy link
Member

Please look at #5599.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Aug 20, 2018
@xavfernandez
Copy link
Member

Closing in favor of #5599

@xavfernandez xavfernandez removed the S: needs triage Issues/PRs that need to be triaged label Oct 16, 2018
@lock
Copy link

lock bot commented May 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

4 participants