Skip to content
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

Anaconda Python environment not activated when running from SublimeText3 SublimeREPL package #576

Open
ZyzotPerplex opened this issue Jun 22, 2019 · 2 comments

Comments

@ZyzotPerplex
Copy link

I am using SublimeText3 with the SublimeREPL package and the Miniconda python installation. I have followed the instructions listed here to run python from SublimeText3 with a custom environment:

https://stackoverflow.com/questions/20861176/how-do-i-setup-sublimerepl-with-anacondas-interpreter

Yet, when I run the Python interpreter from SublimeText3, I initially get

Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

If I then try to

import numpy

I get the following error message:

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\USER\Miniconda3\envs\CUSTOM_ENV\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\Users\USER\Miniconda3\envs\CUSTOM_ENV\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

For other packages such as sympy, I don't get an error when I try to import the package.

Similarly, if I run anaconda from the anaconda prompt and import numpy, it runs without errors.

So it seems that it is calling python from the custom environment but thinks the environment isn't activated and can't load Numpy.

Post is cross-posted here:

https://stackoverflow.com/questions/56713189/anaconda-python-environment-not-activated-when-running-from-sublimetext3-sublime

@weidongzhou1994
Copy link

I also encounter the same problem.

@janxkoci
Copy link

janxkoci commented Jan 27, 2020

I use R from conda, but this should work for other REPLs too. Copy this into user settings of SublimeREPL:

{
    "default_extend_env": {"PATH": "/home/jena/miniconda3/bin:{PATH}"}
}

Obviously tweak the path to correspond to your installation 😉

Edit: I myself used the second answer from your link, long time ago. Tried this on many linux machines, works every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants