-
Notifications
You must be signed in to change notification settings - Fork 986
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
Conan 0.21.2 install on Windows return error #1208
Comments
Yes, bug appeared between 0.19.3 and 0.20.0 |
This issue is usually related with an error message thrown by the operating system containing some character with an unexpected encoding. What's your windows local language? It's failing only with that conanfile or always? We have to investigate it. |
My windows language is Russian. Issue somehow appears only when our grpc package in conanfile.txt, maybe because we changing
|
I think it could be failing somewhere in the Not sure how to reproduce it, I have tried to generate non-ascii chars, but no success. except Exception as exc:
import traceback
print(traceback.format_exc())
msg = exception_message_safe(exc) and try again, that could help. Thanks! |
Yes I will try later other things |
Everything works fine with conan.py from github, even when I checkout tag `0.21.2' |
I can't try conan from pip because of #298 |
I reinstall my Python 3.6 (64bit) to root directory and install conan from it. Conan works fine from pip |
I tried to install Conan installer to root directory and this doesn't help. Same error:
|
This error only with Python 2(2.7)!
|
Pip is the most recommended way to install conan. If you cannot do it because your main Python installation is in a path with spaces, I would recommend using virtualenvs, they are easy, convenient and clean solution, please check http://docs.conan.io/en/latest/faq/troubleshooting.html#error-failed-to-create-process |
Thanks very much for your detailed reports. If it doesn't happen with the pip package, it seems some issue with the package generated by pyinstaller, and there is little we can do. |
Yes, it still fails with pip in Python 2.7 |
I have been having a look at this for a while, still no idea how to fix, because it is very convoluted with the environment variables encoding. Quick question: is it possible that you are adding some environment variables to self.env_info.PATH = [u"some/unicode/path"] or maybe a package recipe declaring encoding in the first line like |
I find out that in Python2 This fix issue for me:
|
I am also working on this, but so far, in my tests, if I provide env_vars as Unicode strings,
Also, if I try to convert str to unicode, then the line File "C:\Users\memsharded\conanws\conan\conans\tools.py", line 122, in environment_append
os.environ.update(env_vars)
File "C:\Users\memsharded\Envs\conan\lib\os.py", line 461, in update
self[k] = dict[k]
File "C:\Users\memsharded\Envs\conan\lib\os.py", line 422, in __setitem__
putenv(key, item)
UnicodeEncodeError: 'ascii' codec can't encode character ... Because, as you said, os.environ is ordinary strings, so it tries to convert them from unicode to ascii. If we do it explicitely, non-ascii characters will be lost, and if the environment variables are Paths that contain Russian characters, it will not work. Maybe python2 support is insufficient for handling environament variables referencing filesystems with non-ascii characters, and python3 should be the default. |
I think probably because my default encoding CP1251, Python2 can convert Unicode string like "привет" to ordinary string for me. |
Can you just use my quick fix?
Is it possible to use pyinstaller with Python3? |
@KindDragon We could put the 'str' but first we need to understand why your values in |
It's from our grpc package: Our grpc package contains this line:
|
Thanks for the info, |
Sorry about the delay. The problem with your quick fix is that it might be forcing a conversion to str in an earlier point than previously, and that could raise encoding errors for other users with other default encoding, that wouldn't happen for them otherwise. This need some caution. We'll try to announce a release candidate in due time, so users can verify everything is fine. |
Now there are pyinstaller created installer for python3 too, which might solve this issue. Recent work from @mpdelbuono shows that it is nearly impossible to have reliable unicode pathnames with python 2.7, so indeed the recommended way is to use the python3 based conan. I am closing this issue, but if the problem still persists in python3, please re-open or comment. Thanks! |
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 10: ordinal not in range(128) conan returned -1
Conan installed using Windows installer
The text was updated successfully, but these errors were encountered: