Conda can't create new environment - PyCharm on Apple Silicon 关注
Can anyone offer hints how to fix this?
I have a brand new PyCharm CE 2022.3.2 install on my M1 Max with macOS Monterey 12.5.1. when I either create a new project with conda env, or Add Interpreter
by creating a new conda environment. It complains
[Errno 2] No such file or directory" './bin/bash' ()
as the error shown below.
However, I can run the Executed command
on my $bash
, it worked fine and created the environment.
Then I tried older versions until PyCharm 2021.1.3, it starts to create new conda environment for me.
- 2022.3.2 - macOS Apple Silicon (dmg) - not working
- 2022.3.1 - macOS Apple Silicon (dmg) - not working
- 2021.2.4 - macOS Apple Silicon (dmg) - not working
- 2021.2 - macOS Apple Silicon (dmg) - not working
- 2021.1.3 - macOS Apple Silicon (dmg) - working
- 2020.3.5 - macOS Apple Silicon (dmg) - working
Hope I have provided enough details on this issue. Currently I have to stay with older version.
请先登录再写评论。
Hello,
Please upload logs folder zipped from ***Help | Collect logs and Diagnostic Data*** to the FTP
https://uploads.jetbrains.com/ and please let me know the filename.
> I can run the
Executed command
on my$bash
, it worked fine and created the environment.Could you please attach a screenshot?
Just a matter of test, please try to start IDE with default settings as described [here](https://www.jetbrains.com/help/pycharm/configuring-project-and-ide-settings.html#restore-defaults)
Upload id: 2023_03_18_nEvwxEYnBbVwD7fKnBzCDd (file: 230317 pycharm2022.3.3.tgz)
files included:
Error screen shot: Screen Shot 2023-03-17 at 10.36.30 PM.png
Conda ran on Bash: Screen Shot 2023-03-17 at 10.39.23 PM.png
PyCharm log folder: pycharm-logs-20230317-2240516087157034071697396.zip
Thanks.
From the idea.log, I found this
2023-03-08 21:51:13,475 [ 37607] SEVERE - #c.i.o.u.ObjectTree - Error code: 132. /var/folders/s0/djbpvm4j4rd6f6c8jnbct9100000gp/T/tmp8n_70pxz: line 3: 56415 Illegal instruction: 4 python -c 'import sys; print(sys.executable)'
PyCharm calls `python` which is python2 in my system. Since python2 is EOL already, and M1 is running arm64, I might hit some system issue. I have to call python3 explicitly to avoid illegal instruction in my projects. Not sure is it Apple, conda, or brew issue? I am still trying to twist these setups to get it to work without messing the system.
From the PyCharm side, if it calls python3 directly, it would help. Interesting thing is that the last working version 2021.1.3 is working in my system. There might be some changes after this release changed this behavior.
Any advice would be appreciated e.g. how to force PyCharm to use specific Python runtime?
After I temporary changed the symbolic link `python` to `python3`, I still get the same error. I no longer find the Illegal Instruction in the idea.log. Here I upload my latest log file from my installation. Hope this help to diagnose the problem.
Upload id: 2023_03_19_trryNTWWz3iwnUv5T5Cs4f (file: pycharm-logs-20230318-21454317123954612019230515.zip)
Thanks
Thank you for the logs and screenshots.
Could you please share the bashrc file too? What is the bash location? Please run ``which bash`` and provide me the output.
Just a matter of test, please try to start IDE with default settings as described [here](https://www.jetbrains.com/help/pycharm/configuring-project-and-ide-settings.html#restore-defaults) - will it make any difference?
Just uploaded the .bashrc and .profile just in case you need it (.profile was trimmed unrelated stuff)
Upload id: 2023_03_21_Upk93BAVUuaQ9nxvcVwrGp (file: bashrc_profile.tgz)
I forgot to tell you that I did reset the IDE to default settings already. Still have the same problem.
Thanks
Please try to
1. go to Help | Find Action | Registry
2. disable python.use.targets.api
Will it make any difference?
Same error. Didn't seem make much different :(
Well, I have checked on my M1 machine and I have python - referred to Python 2.7 too, however it does not cause any issues.
Another guess is to reinstall conda.
I have submitted an issue in our bug tracker system https://youtrack.jetbrains.com/issue/PY-59710/Conda-env-creation-failure-No-such-file-or-directory-.-bin-bash please follow it for updates.
Information on how to use YouTrack: https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications
Thank you so much for your help to validate the issue. I will follow your advice. I can live with this issue for now, and hope this helps you guys make a better product.