-
Notifications
You must be signed in to change notification settings - Fork 766
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
Question about enviroment problems when compiling pyo3 #1105
Comments
the error you get when running without sudo rm -rf /Users/chenbowen/CLionProjects/ruststudy/target which will delete your |
^ As jake says regarding the If you're still having issues after that, can you please run the |
Sincerely thank you for your reply, I tried using your command then use run in CLion which will build the project firstly, but the problem is still here in the same way. What does the target directory do in a project? Would this be a problem that caused by the conflict between anaconda python and system default python? |
The |
Thank you for you detailed explanation, I runed the 'python-config' project and it gives below information:
Should I run with |
Additionally, when I set PYTHONHOME and PYTHONPATH as enviroment variable, the anaconda python was disabled which the anacodna python enviroment cannot not be automatically activated when starts a new shell after I set the enviroment variable. Then the system python could only be called using sudo command Run pure 'python' which would call the system default python2 would give:
Run 'python3' which would use default python3 of OSX would give encoding error again!
Only sudo command could make system python3 or python work again, I guess this phenomenon is related to this problem in here, but I do not know the connection between them. |
No, that backtrace is enough. Something's very strange with your python setup...! I can't help more today, but I will update |
Thank you so much, this problem has troubled me for several days and I could not find answer in the internet. |
If I had to make a guess though, this part of your PATH might be wrong:
what happens if you change that to
? Presumably you set that via |
This path was actually done when installing anaconda3 which will automatically initialize the enviroment variable that relates to anacodna python, I will edit it and see what happens. |
Changing the anaconda enviroment variable did not make things right, but running this project in shell and in IDE gives different output, in shell running 'cargo run' it still gives encodings problem but in a IDE like CLion, cliking run button would give
Which has different outputs, I wonder what could cause the error message not being the same when running in shell and IDE? |
Apologies, didn't get around to this on the weekend; I'll try to add the patch to Regarding your different error messages in shell vs IDE - I guess they have different environment variables? You may want to check your IDE configuration, because I think it won't use your |
Thank you for your reply. The IDE configuration is the same. I would like to know how the rust calls the python? Maybe it find a python but cannot find its related packages that may be used to initialize? |
@PosoSAgapo sorry for the delay in fixing |
As there has been no response on this question for some time, I'm going to close it. Thank you for the discussion. |
🌍 Environment
rustc --version
): rustc 1.46.0-nightly (346aec9b0 2020-07-11)version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
:No💥 Reproducing
Firstly I meet an encoding problem that was described in this issue , which shows setting a PYTHONHOME and PYTHONPATH enviroment variable could solve this problem.
Then I use
where python
in shell to show the python directory and then add it to the .zshrc and sourced .zshrc after I edited this file, now my enviroment variable setting is like below:Then encoding problem was solved but any another problem occured when I was using
sudo cargo +nightly build
:But the error is sightly different when I typing
cargo +nightly run
without sudo:I was struggling about this for several days and do not quite know the exact reason that causes this problem, since the first problem was caused by enviroment variable setting. I guess the problem might still is about enviroment variable, but I did not see that my configuration was wrong.
The text was updated successfully, but these errors were encountered: