Conan: pip install on Windows causes "failed to create process"

Created on 5 Jun 2016  路  27Comments  路  Source: conan-io/conan

When I use pip install conan to install conan, it will be installed successfully but then runinng conan will be failed by this error:

failed to create process

My config is:
Windows 10 64bit
Python 3.5.1 64bit

bug

Most helpful comment

So I had a similar problem yesterday, and it sounds like I can help with this issue. The windows installer for Python3+ 64-bit will put create the python directory under the Program Files (C:\Program Files\Python3x). When you try to run conan, you will be running the conan-script.py in the Python\Scripts directory. The first line of that file when using pip install and default windows installation of Python will look like this #!c:\program files\python35\python.exe. This is a problem because of the space in program files, but can be fixed by encapsulating the path in quotes like so that windows will treat the space as part of the path: #!"c:\program files\python35\python.exe".

TL;DR Encapsulate the path in the first line of C:\Program Files\Python35\Scriptsconan-script.py to #!"c:\program files\python35\python.exe" to fix the issue

All 27 comments

Could you please copy here the output of running "python" and "pip --version"?
I think it is possible that the Python distribution could be 32bits, would you mind trying with a 32bits distro? Also please consider that the support for Python3 has been introduced recently, so it should be a bit less mature than for Python27.
Have you used virtualenvs? I strongly recommend virtualenvwrapper (easily install in win with virtualenvwrapper-win) for everything python related.

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32

pip 8.1.2 from c:\...\python3\tools\lib\site-packages (python 3.5)

I'm not using virtualenv.
The conan works fine by installing via Windows installer you provided.

Glad that it works with the installer. The question is, are you using Python 3.5 for something else? Would you mind installing instead the x86 version? https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe

If you are just fine running with the installer version, then this issue could be closed. Thank you!

I have no problem with anything other than pip install with Python 3.5-64. I think you should not close this issue, although I understand that you haven't plan to fully support Python 3 for now.

Yes we plan to support Python3, we will improve it, accept pull rquests related to it... it is just that it was recently introduced and it might be slightly less mature. This seems not to be a Python3 issue, but a Python3 64bits - 32bits issue. There are other users using Python3 from pip successfully, so my guess was the python 32/64. Ok, lets keep this open, it is not an urgent issue, as you can work from the installer, we will have a look when possible. Thanks again!

Just tested with Python 3.5.1 x86 on Windows 10, and pip install conan installed fine, so I am pretty sure the issue is with x86-64 Python 3.

Same issue with:

> python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

I ran into this issue also with both the 32-bit and 64-bit versions of Python. When installing Python, I used the defaults, so in both cases, Python was installed into either C:\Program Files or C:\Program Files (x64). However, everything works properly if I install Python to C:\Python35. Even with the 64-bit version.

I suspect the issue is actually the space in the path as covered in https://github.com/pypa/pip/issues/2783.

Probably, in fact I always install python to C:/PythonXX in windows.

I am trying to reproduce the issue with 32 bits python3 (as reported by @KindDragon to fail), without success:

$ which python
/c/Users/memsharded/Envs/conanpip3/Scripts/python
$ python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Conan installs and runs just fine. I am using virtualenvs, and the path for python is also without spaces.

For the path with spaces issue, there is little that conan can do to fix it. So IMHO the remaining issue would be to create pip packages for conan for Python3-64bits.

I am trying to reproduce the issue with 32 bits python3 (as reported by @KindDragon to fail), without success:

Still can reproduce:

> pip install conan
> python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
> where python
c:\Program Files (x86)\Python35-32\python.exe
> where conan
c:\Program Files (x86)\Python35-32\Scripts\conan.exe

"c:\Program Files (x86)\Python35-32\Lib\site-packagesconansconan.py" works fine

Same issue with 64-bit Python:

$ python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

pip install conan work with Python 2.7.11 BTW

Same results with 0.12

Process Monitor shows that conan.exe trying to run
C:\program "files" "(x86)\python35-32\python.exe" "C:\Program Files (x86)\Python35-32\Scripts\conan-script.py"

So issue with Python path that contain spaces

Yes, certainly, thanks for debugging this. The only problem is that the conan.exe is not under our control, it is created by pip, so I guess very little we can do here. Maybe submit the issue to pip project?

I found pip issue https://github.com/pypa/pip/issues/2783
Please mention in this issue that it is important for your project

@KindDragon I see a merged PR and should be currently released in setuptools. I don't know if pypi needs to update something too. I've generated a pip package for the develop branch, Could someone try it?

pip install conan==0.12.1.dev0

Nope, same result: "failed to create process."

@KindDragon thanks, So pypi site have to update its setuptools too. :(

So I had a similar problem yesterday, and it sounds like I can help with this issue. The windows installer for Python3+ 64-bit will put create the python directory under the Program Files (C:\Program Files\Python3x). When you try to run conan, you will be running the conan-script.py in the Python\Scripts directory. The first line of that file when using pip install and default windows installation of Python will look like this #!c:\program files\python35\python.exe. This is a problem because of the space in program files, but can be fixed by encapsulating the path in quotes like so that windows will treat the space as part of the path: #!"c:\program files\python35\python.exe".

TL;DR Encapsulate the path in the first line of C:\Program Files\Python35\Scriptsconan-script.py to #!"c:\program files\python35\python.exe" to fix the issue

I also had the "_failed to create process._" message.

Adding quotes to the path of python in _conan-script.py_, as proposed by @wRastel solved this problem on my machine (Python 3.4 32bit, installed in "C:\Program Files (x86)\Python34\").

Maybe those quote should be added by default?

Thanks @Pixinn for reporting. The thing is that it is out of our scope, and it is more a python issue than a conan issue. You can check https://github.com/conan-io/conan/blob/develop/setup.py, this is what we are using to create the python package. Is python/pip/setuptools what is creating that conan-script.py file with such path to your local python installation.

https://github.com/pypa/pip/issues/2783
https://github.com/pypa/setuptools/issues/398

It seems that some solutions have ben provided, but maybe they are not merged in py3.4 and only in latest 3.5 or 3.6?

My suggestion: Install python in C:\Python3X, or maybe better, be clean, and install virtualenvwrapper-win and use virtualenvs for everything python related.

Thanks for your answer @memsharded. You're right, its a python issue and not a conan one, I did not realize it. Furthermore, this pb was indeed corrected in python 3.5.3.

Thanks @Pixinn for telling. I think this issue can be closed now, nothing we can do here. I have added a note in the docs->Install instructions (will be published in a couple of days), clarifying this point.

JFYI issues still exist with Conan 0.21.2

Hi @KindDragon , thanks for updating the status. Yes it is still failing ,but also still something that is out of our reach, it is under the control of Python. Unfortunately, we can't do anything to fix this, just recommend (as done in the notes of http://docs.conan.io/en/latest/installation.html) to install python in a path without spaces (or use virtualenvs-recommended for everything related to python, in some path without spaces)

We have added a section in "troubleshoot", briefly explaining how to use virtualenvs, which is a practical and elegant solution to this issue: http://docs.conan.io/en/latest/faq/troubleshooting.html#error-failed-to-create-process

Was this page helpful?
0 / 5 - 0 ratings