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 install on Windows causes "failed to create process" #298

Closed
evakili opened this issue Jun 5, 2016 · 30 comments
Closed

pip install on Windows causes "failed to create process" #298

evakili opened this issue Jun 5, 2016 · 30 comments

Comments

@evakili
Copy link

evakili commented Jun 5, 2016

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

@memsharded
Copy link
Member

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.

@evakili
Copy link
Author

evakili commented Jun 6, 2016

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.

@memsharded
Copy link
Member

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!

@evakili
Copy link
Author

evakili commented Jun 13, 2016

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.

@evakili evakili closed this as completed Jun 13, 2016
@evakili evakili reopened this Jun 13, 2016
@memsharded
Copy link
Member

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!

@emmatyping
Copy link

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.

@KindDragon
Copy link

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.

@IntegralLee
Copy link

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 pypa/pip#2783.

@memsharded
Copy link
Member

memsharded commented Aug 20, 2016

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.

@KindDragon
Copy link

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-packages\conans\conan.py" works fine

@KindDragon
Copy link

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.

@KindDragon
Copy link

pip install conan work with Python 2.7.11 BTW

@KindDragon
Copy link

KindDragon commented Sep 19, 2016

Same results with 0.12

@KindDragon
Copy link

KindDragon commented Sep 19, 2016

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

@memsharded
Copy link
Member

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?

@KindDragon
Copy link

I found pip issue pypa/pip#2783
Please mention in this issue that it is important for your project

@lasote
Copy link
Contributor

lasote commented Sep 20, 2016

@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

@KindDragon
Copy link

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

@lasote
Copy link
Contributor

lasote commented Sep 20, 2016

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

@wRastel
Copy link

wRastel commented Sep 23, 2016

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\Scripts\conan-script.py to #!"c:\program files\python35\python.exe" to fix the issue

@Pixinn
Copy link

Pixinn commented Mar 9, 2017

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?

@memsharded
Copy link
Member

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.

pypa/pip#2783
pypa/setuptools#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.

@Pixinn
Copy link

Pixinn commented Mar 10, 2017

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.

@memsharded
Copy link
Member

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.

@KindDragon
Copy link

KindDragon commented Apr 13, 2017

JFYI issues still exist with Conan 0.21.2

@memsharded
Copy link
Member

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)

@memsharded
Copy link
Member

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

@bishwas-bh
Copy link

Yupp, this solution for this issues of Unable to create process using in venv. This will surely help you and fix your issues.

@MLIOSBond
Copy link

If anyone gets failed to create process or Unable to create process (after creating a virtual environment) — this answer from SO is on point.

I got these errors after installing VS 2022. The VS installer really does some weird things with spaces in paths...

I deleted VS logs in my user directory — and after that conan run just fine.

@memsharded
Copy link
Member

Thanks for the tip @MLIOSBond. Certainly one of the things that I have learned to avoid is path with spaces in Windows, specially in user/account name. Really a pain for many tools out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants