randlab / geone

DeeSse interface, utilities and examples
Other
37 stars 11 forks source link

cannot import name 'deesse' from 'geone.deesse_core' (unknown location) #7

Closed cultpenguin closed 2 years ago

cultpenguin commented 2 years ago

HI I created a new conda pyhton 3.9 environment and installed geone using

python3 -m pip install .

After that I failed to import geone: I got this:

(randlab) tmeha@RYZEN:/mnt/d/PROGRAMMING/GITHUB/geone$ python3 Python 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import geone as ge Traceback (most recent call last): File "", line 1, in File "/mnt/d/PROGRAMMING/GITHUB/geone/geone/init.py", line 5, in import geone.deesseinterface File "/mnt/d/PROGRAMMING/GITHUB/geone/geone/deesseinterface.py", line 17, in from geone.deesse_core import deesse ImportError: cannot import name 'deesse' from 'geone.deesse_core' (unknown location)

Any idea what the problem is?

See you

alecomunian commented 2 years ago

I experience the same problem using Python 3.10.4. It should be something related to where setuptools puts the binary files provided with the package (see for example this link). For the moment, I've not been able to modify properly the file setup.py, but the package works if I manually copy the files contained in the linux_py310 folder into the lower level folder (for the two folders deesse_core and geoclassic_core). Hope this helps :-)

julien-straubhaar commented 2 years ago

We get this error [ImportError: cannot import name 'deesse' from 'geone.deesse_core' (unknown location)] in a python session if it has been launched from the directory, containing the file "setup.py" and and the "sources" of geone, from which geone is installed (via "python -m pip install ."). In this situation, "import geone" will search the package in the current directory, which causes the error. It suffices to launch a python session from another directory, then "import geone" should work.

alecomunian commented 1 year ago

Hello Julien, I still have the same problem, even if I don't run the python session from the directory where the geone sources are. Nevetheless, it works fine if I do as suggested in my previous post. Bests, Alessandro