Git Product home page Git Product logo

Comments (5)

jan-janssen avatar jan-janssen commented on June 11, 2024

@niklassiemer Are you also using pyiron with WSL on windows? It sounds to me like and issue with the WSL interpreter not finding the environment variable ${CONDA_PREFIX} but I am not sure how to validate this: https://www.jetbrains.com/help/pycharm/using-wsl-as-a-remote-interpreter.html

@ahmedabdelkawy Can you try to print ${CONDA_PREFIX} on the command line? or in python using os.environ["CONDA_PREFIX"] ? If these are not set then pyiron can not find the resources and consequently cannot find the periodic table.

from pyiron.

ahmedabdelkawy avatar ahmedabdelkawy commented on June 11, 2024

Thanks, Jan, for the fast reply.

In Pycharm using python interpreter, os.environ["CONDA_PREFIX"] gives:
File ~/anaconda3/lib/python3.9/os.py:679, in _Environ.getitem(self, key)
676 value = self._data[self.encodekey(key)]
677 except KeyError:
678 # raise KeyError with the original key value
--> 679 raise KeyError(key) from None
680 return self.decodevalue(value)

KeyError: 'CONDA_PREFIX'

In WSL terminal using python, os.environ["CONDA_PREFIX"] gives: '/home/abdelkawy/anaconda3'

${CONDA_PREFIX} in WSL terminal Gives:
-bash: /home/abdelkawy/anaconda3: Is a directory

from pyiron.

niklassiemer avatar niklassiemer commented on June 11, 2024

I am using pycharm with the windows python.

Could you try import sys; print(sys.executable); print(sys.path) from the wsl python and the pycharm python?

from pyiron.

ahmedabdelkawy avatar ahmedabdelkawy commented on June 11, 2024

Pyiron installed in base
base is activated in WSL and base interpreter is selected in pycharm

WSL python:
print(sys.executable)
/home/abdelkawy/anaconda3/bin/python
print(sys.path)
['', '/home/abdelkawy/anaconda3/lib/python39.zip', '/home/abdelkawy/anaconda3/lib/python3.9', '/home/abdelkawy/anaconda3/lib/python3.9/lib-dynload', '/home/abdelkawy/anaconda3/lib/python3.9/site-packages']

pycharm python:
print(sys.executable)
/home/abdelkawy/anaconda3/bin/python3
print(sys.path)
['/mnt/c/Users/abdelkawy/Desktop/new_project_7', '/mnt/c/Users/abdelkawy/Desktop/new_project_7', '/mnt/c/Program Files/JetBrains/PyCharm 2022.2/plugins/python/helpers/pycharm_display', '/home/abdelkawy/anaconda3/lib/python39.zip', '/home/abdelkawy/anaconda3/lib/python3.9', '/home/abdelkawy/anaconda3/lib/python3.9/lib-dynload', '/home/abdelkawy/anaconda3/lib/python3.9/site-packages', '/mnt/c/Program Files/JetBrains/PyCharm 2022.2/plugins/python/helpers/pycharm_matplotlib_backend']

from pyiron.

niklassiemer avatar niklassiemer commented on June 11, 2024

Ok, both ways use the same executables (ans similar python paths), however, the pycharm interpreter does not know about the conda environment it runs in. This can be fixed by providing environment variables to be set for a given interpreter in pycharm. I would have to look up the exact location, however, pycharm offers a possibility to add environment variables to the interpreter. I just wonder why the conda environment is not setting these...

from pyiron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.