0

I had an issue with my anaconda and I had to reinstalled it. I set the path to my environment variable and installed everything correctly but every time I open cmd and type 'python' I get a warning to activate my environment.

I can still use base python despite the warning but I cant import any packages at all, if I try I get the module not found error.

So I type the command "activate " and then I can enter python and I can use all my packages just fine. The problem is that I have to type "activate " every time I open a new cmd or the old issue keeps appearing.

Also when I write any code in my sublime text editor I cannot use any packages at all, just the base python. It seems my environment is not getting activated unless I type in the command, but then it goes away each cmd session and I cant use sublime text with any packages.

Does anyone have any idea why this is? I have spent most of the day trying to get this to work

Logica
  • 977
  • 4
  • 16
Gmuersch
  • 11
  • 2
  • 1
    What system are you on? Windows cmd? Linux bash? Is Powershell an option? – neutrino_logic Nov 06 '19 at 23:59
  • oops I am using windows 10 – Gmuersch Nov 07 '19 at 00:01
  • That's how virtual environments work, they're not supposed to replace your local python, that's the whole point – Sayse Nov 07 '19 at 00:10
  • Well it's pretty easy if you use Powershell rather than cmd. You can edit the $profile variable and put in the line ```conda activate myenv``` . https://superuser.com/a/886960 Otherwise if you use cmd you have to mess about with registry keys https://stackoverflow.com/questions/17404165/how-to-run-a-command-on-command-prompt-startup-in-windows – neutrino_logic Nov 07 '19 at 00:10
  • @Sayse true enough but if you mostly work in one virtual env its convenient to activate it every time you open a new window, then just deactivate it as needed. – neutrino_logic Nov 07 '19 at 00:12
  • I just dont get why I cant use any packages with sublime even though everything is set up. I never had to activate my environment every time before – Gmuersch Nov 07 '19 at 00:28
  • Don't manipulate `PATH`, but instead use `conda init` to configure your shell. Duplicate: [How to run Conda?](https://stackoverflow.com/questions/18675907/how-to-run-conda), specifically [this answer](https://stackoverflow.com/a/55526573/570918) has the latest best practice. – merv Nov 07 '19 at 16:27

0 Answers0