-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot activate conda env when created in a path #16562
Comments
Hey @jrenardOceanSonics, thanks for reporting. This is certainly a use case we haven't tried on Windows. @dalthviz, could you try to reproduce this problem on your side? Thanks! |
@ccordoba12 @jrenardOceanSonics I was able to reproduce this, athough the message about the activation only happens to me when doing a kernel restart. However in both cases the env var set with conda doesn't exist. |
Ok, but does the kernel restart after the message is displayed? |
This is what I'm seeing @ccordoba12 : After restart: In a new Console instance: |
Ok, I see. @dalthviz, could you verify that the interpreter is the one in the environment by running |
Ok, so I think the problem is just that environment is nor properly activated. |
@ccordoba12
I think this problem will nag many people, hope it can be resolved in the near future. |
I have the same issue on 5.3.2. When I start Spyder I'm always greeted with the "An error ocurred while starting the kernel" error in red and the following text:
What worries me now is that in the past (pre 5.3.2) I could click on "New console" and a new console would start right away (while still printing the text about "the following argument..."). However, now I sometimes need to start 3-4 new consoles before a console actually starts. I've installed Spyder on Windows with the standalone installer. |
@ba-tno I have the same issue on 5.3.2. |
Just in case, I was able to reproduce the Could this error by related with installations for all users (installation with Admin privileges) using either the standalone installer or Anaconda/Miniconda? |
Just tested: I uninstalled standalone Spyder 5.3.2, which was installed "for all users" (with Admin privileges), and installed it again "just for me" (using the the standalone installer). Now the console starts without error when using a custom interpreter. If it matters: my Miniconda is also installed "just for me" in |
Note: Seems like this issue could be relevant here - mamba-org/mamba#1881 (for the per environment environment variables part of the OP, at least if you are using the standalone installer which uses the micromamba executable to activate envs) |
What steps will reproduce the problem?
1 Create a conda environment with the --prefix option, specifying a path rather than an environment name.
2 install spyder-kernel in the environment.
3 Inside the new environment, create an environment variable using: conda env config vars set MY_VAR='HELLO'
4 launch spyder from another conda environment (can be the base environment)
5 change the Python Interpreter to point to the python.exe file in the new environment.
The path is obtained from the command: python -c "import sys; print(sys.executable)"
6 Create a new console or restart the kernel. Spyder outputs the message '<path_to_env>/Scripts/activate' is not recognized as an internal or external command.
7 Check that the environment variable MY_VAR does not exist.
If the environment is created with a name and placed in the default miniconda3/envs directory, there is no issue and the new environment appears directly in the Spyder drop-down menu for the Python interpreter.
Environment
Installation from miniconda3
The text was updated successfully, but these errors were encountered: