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条回答
啃猪蹄的小仙女
2楼-- · 2019-01-08 11:17

I got the same error but when using tensorboard:

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

I found out that the problem was caused by existing two copies of tensotboard.exe in two different directories and both directories were added to the path:

C:\Program Files\Python36\Scripts

and

C:\Users\...\AppData\Local\Programs\Python\Python36\Scripts

I removed the first one from the path and it fixed the problem.

查看更多
乱世女痞
3楼-- · 2019-01-08 11:19

I met the the same error as you.that is because i had transplanted my python file from D disk to e disk. after that ,when I inputed python ,it worked. pip and other exe file which has the same path as pip ,it did not work. when "python -m pip install --upgrade pip" order was inputed,pip order worked,but other exe file which has the same path as pip did not work,so i think it is not the best way. at last I unistalled my python,and re-install it.everything is okay.maybe it is not the best way for all of you ,but it is for me.

查看更多
神经病院院长
4楼-- · 2019-01-08 11:23

The same error, but in a different situation. I have a virtual environment, in which I ran, in the VE's \Scripts directory where pip.exe is:

pip freeze

I got the error message

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

There is no space in my VE path (google that error). Then I tried python -m pip install --upgrade pip and got

Requirement already up-to-date: pip in o:\upsdowns\flask\lib\site-packages

so then I tried

python -m pip freeze

and that worked. I think it might be a path issue in the VE, but I'm OK with this workaround.

I'm adding this here because this page is high up when you google that errormessage. In other words, I didn't make a new question, even though my situation is quite different from the OP's. Possibly even, I got into that situation because I didn't add modules to the virtual environment "properly".

Anyway, I hope it helps some.

查看更多
小情绪 Triste *
5楼-- · 2019-01-08 11:23

Checked the evironment path, I have two paths navigated to two pip.exe and this caused this error. After deleting the redundant one and restart the PC, this issue has been fixed. The same issue for the jupyter command fixed as well.

查看更多
混吃等死
6楼-- · 2019-01-08 11:25

I started seeing the

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

after installing Python 3.6 onto a Windows 10 machine. I set the Path variable to point to the Python36 folder. The python command functioned correctly, but the pip command did not.

To fix the error, I opend up the command prompt shell with administrator privileges and ran the pip commands.

查看更多
疯言疯语
7楼-- · 2019-01-08 11:26

I got the same error when installed both python2 and python3 on my Windows 7.

You can use python3 -m pip install xxxxxx to install your package.

Or, fix it completely:

  1. Try to run python3 -m pip install --upgrade pip in cmd.

  2. If failed in step 1, try python3  -m pip install --upgrade --force-reinstall pip

查看更多
登录 后发表回答