jannikmi / multivar_horner

python package implementing a multivariate Horner scheme for efficiently evaluating multivariate polynomials
https://multivar-horner.readthedocs.io/en/latest/
MIT License
27 stars 3 forks source link

ModuleNotFound Error on fresh install #26

Closed pomeroyb closed 2 years ago

pomeroyb commented 2 years ago

In an empty directory, I create a ./venv folder and run the following: python -m venv .\venv\

I am on Python 3.8.10 on a Windows 10 machine.

I update pip to the latest version with: python -m pip install --upgrade pip

I am on pip 22.1.2

I then run: pip install multivar_horner[numba]

Running pip freeze shows the following:

llvmlite==0.38.1
multivar-horner==3.0.0
numba==0.55.2
numpy==1.22.4

I then open up a python command line, and attempt to import the Multivar Polynomial, as shown in the Getting Started docs:

(venv) PS F:\Downloads\HornerTest> python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy as np
>>> from multivar_horner.multivar_horner import HornerMultivarPolynomial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Downloads\HornerTest\venv\lib\site-packages\multivar_horner\__init__.py", line 2, in <module>
    from multivar_horner.classes.abstract_poly import load_pickle
ModuleNotFoundError: No module named 'multivar_horner.classes'
>>>

Please let me know what I might be doing wrong here!

jannikmi commented 2 years ago

Sorry, it should just be

from multivar_horner import HornerMultivarPolynomial

Thanks for pointing this out. I will fix it in the documentation.

jannikmi commented 2 years ago

let me know if you encounter other errors

pomeroyb commented 2 years ago

Unfortunately I see the same error message:

(venv) PS F:\Downloads\HornerTest> python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy as np
>>> from multivar_horner import HornerMultivarPolynomial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Downloads\HornerTest\venv\lib\site-packages\multivar_horner\__init__.py", line 2, in <module>
    from multivar_horner.classes.abstract_poly import load_pickle
ModuleNotFoundError: No module named 'multivar_horner.classes'
>>>

I also do not seem to have the multivar_horner/classes folder in my venv/lib/site-packages. image

I will try to download the latest release from github and see if there is any different results.

pomeroyb commented 2 years ago

Ok, I am able to successfully run

from multivar_horner import HornerMultivarPolynomial

when I download the 3.0.2 file from Github release, and build the project locally.

I attempted to download 3.0.2 from pip, and got the previous error. Downloading the source from PyPi Source distribution shows that the "classes" folder is missing from it.

jannikmi commented 2 years ago

Ok, thanks for reporting this. I will fix it.

jannikmi commented 2 years ago

Please check if this got fixed with the latest version 3.0.3. It was due to using poetry based dependency management (and it automatically influencing the packaging)

pomeroyb commented 2 years ago

Can confirm 3.0.3 works on a fresh install. 👍