Pip - Fatal error in launcher: Unable to create pr

2019-01-08 11:00发布

I installed python 3.5.1 via ampps and it's working. However, when i try to use pip, i get the following message:

Fatal error in launcher: Unable to create process using '"'

I already reinstalled ampps into a path which doesn't include any whitespaces. Note that the "python -m pip" workaround doesn't work for me too, since i get the following message everytime i use it:

C:\Users\MyUserName\Desktop\Ampps\python\python.exe: Error while finding spec for 'pip.__main__' (<class 'ImportError'>: No module named 'queue'); 'pip' is a package and cannot be directly executed

How do i get pip to work properly? I hope, there is a way to use the pip command itself without the preceding python command.

EDIT: This is what happens, if i try to run python -c "import pip.__main__":

Traceback (most recent call last):
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat\__init__.py", line 11, in <module>
    from logging.config import dictConfig as logging_dictConfig
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\config.py", line 30, in <module>
    import logging.handlers
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\handlers.py", line 28, in <module>
    import queue
ImportError: No module named 'queue'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\__init__.py", line 13, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\utils\__init__.py", line 18, in <module>
    from pip.compat import console_to_str, stdlib_pkgs
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat\__init__.py", line 13, in <module>
    from pip.compat.dictconfig import dictConfig as logging_dictConfig
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat\dictconfig.py", line 22, in <module>
    import logging.handlers
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\handlers.py", line 28, in <module>
    import queue
ImportError: No module named 'queue'

21条回答
Explosion°爆炸
2楼-- · 2019-01-08 11:03

neither of the other answers helped me case: downgrading python from 3.6 to 3.5 for using pyinstaller package.

here is the solution for this specific case:

  1. pip uninstall
  2. go to C:\Users\your-usern\AppData\Local\Programs\Python\Python36\Scripts
  3. delete the script resembling , i.e pyinstaller.exe in my case
  4. pip install

may probably work for you as well.

查看更多
Explosion°爆炸
3楼-- · 2019-01-08 11:03

My solution is to run twine upload over the python -m argument.

So just use python -m:

python -m twine upload dist/*

查看更多
等我变得足够好
4楼-- · 2019-01-08 11:05

I started seeing this error after I moved my project (including its virtual environment). Deleting and recreating the virtual environment set everything right.

As RolfBly mentioned, running python -m pip freeze > somefile prior to deleting the environment allows for quick recovery: running pip -r somefile in the new environment will restore all packages.

查看更多
放我归山
5楼-- · 2019-01-08 11:07

I found a very simple solution to, (Pip - Fatal error in launcher:)

1) You must not have multiple environmental variables for the python path.

A) Goto Environmental Variables and delete Python27 in the path if you have Python 3.6.5 installed.  Pip is confused by multiple paths!!!
查看更多
beautiful°
6楼-- · 2019-01-08 11:07
D:\Python36\Scripts>pip3 -V
Fatal error in launcher: Unable to create process using '"'

D:\Python36\Scripts>python3 -m pip freeze
beautifulsoup4==4.5.1
bs4==0.0.1
Naked==0.1.31
pycrypto==2.6.1
PyYAML==3.12
requests==2.11.1
shellescape==3.4.1
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

D:\Python36\Scripts>python3 -m pip install --upgrade pip

D:\Python36\Scripts>pip3 -V
pip 9.0.1 from d:\python36\lib\site-packages (python 3.6)
查看更多
Explosion°爆炸
7楼-- · 2019-01-08 11:09

One more very basic and simple solution. Run the related python version's installation file (setup file) and click repair mode. It hardly takes one-two minutes and everything works perfectly after that :)

查看更多
登录 后发表回答