Giter Site home page Giter Site logo

Comments (5)

aperezhortal avatar aperezhortal commented on May 27, 2024 2

Hi @wcwoo, this error is caused by the root pysteps repository folder being recognized as the pysteps package. Any directory on sys.path with a name that matches the package name (pysteps in this case) that is being looked for, will be recognized as contributing modules and sub-packages to that package. The error is happening because the the first directory in sys.path is the current working directory.

More information about this here.

from pysteps.

dnerini avatar dnerini commented on May 27, 2024

Hi @wcwoo!
What is your working directory?
I was able to reproduce your error when launching python from within the pysteps folder with the source code:

(pysteps) -bash-4.2$ pwd
/home/ned/pysteps
(pysteps) -bash-4.2$ python
Python 3.6.6 |Anaconda, Inc.| (default, Oct  9 2018, 12:34:16)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysteps
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ned/pysteps/pysteps/__init__.py", line 15, in <module>
    from . import motion
  File "/home/ned/pysteps/pysteps/motion/__init__.py", line 3, in <module>
    from .interface import get_method
  File "/home/ned/pysteps/pysteps/motion/interface.py", line 5, in <module>
    from pysteps.motion.vet import vet
  File "/home/ned/pysteps/pysteps/motion/vet.py", line 30, in <module>
    from pysteps.motion._vet import _warp, _cost_function
ModuleNotFoundError: No module named 'pysteps.motion._vet'
>>>

Moving to any other folder avoids the error:

(pysteps) -bash-4.2$ cd examples/
(pysteps) -bash-4.2$ pwd
/home/ned/pysteps/examples
(pysteps) -bash-4.2$ python
Python 3.6.6 |Anaconda, Inc.| (default, Oct  9 2018, 12:34:16)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysteps
Pysteps configuration file found at: /home/ned/.pysteps/pystepsrc
>>>

I'm not sure what it's causing the problem, my guess is that there is some sort of path conflict when pysteps is imported from within its main directory. Do you have a better idea @aperezhortal? Is there an easy fix we can implement?

from pysteps.

wcwoo avatar wcwoo commented on May 27, 2024

My working directory was just /home/wcwoo/pysteps. I confirm that invoking python from another directory avoids the problem. Thanks!

(pysteps) wcwoo@wcwoo-VirtualBox:~/pysteps$ cd examples
(pysteps) wcwoo@wcwoo-VirtualBox:~/pysteps/examples$ python
Python 3.6.7 | packaged by conda-forge | (default, Nov 21 2018, 03:09:43) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysteps
Pysteps configuration file found at: /home/wcwoo/.local/lib/python3.6/site-packages/pysteps-0.2-py3.6-linux-x86_64.egg/pysteps/pystepsrc

from pysteps.

dnerini avatar dnerini commented on May 27, 2024

OK, so this is actually normal behavior rather than a bug. Thanks @aperezhortal for the explanation!

from pysteps.

wcwoo avatar wcwoo commented on May 27, 2024

I see. Thanks for your explanations.

from pysteps.

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.