treverhines / RBF

Python package containing the tools necessary for radial basis function (RBF) applications
MIT License
215 stars 50 forks source link

Cannot import from extension modules #22

Open CsatiZoltan opened 2 years ago

CsatiZoltan commented 2 years ago

I installed RBF. However, I cannot import anything from the extension modules. Interestingly, if I work from the build directory (for me, it is /RBF/build/lib.linux-x86_64-3.7), there is no issue. The problem arises when Python imports from the installed .egg file. For instance:

>>> from rbf.linalg import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/RBF-2021.5.15+7.g50e4b5d-py3.7-linux-x86_64.egg/rbf/linalg.py", line 14, in <module>
ImportError: cannot import name 'row_norms' from 'rbf.sputils' (/home/zoltan/.cache/Python-Eggs/RBF-2021.5.15+7.g50e4b5d-py3.7-linux-x86_64.egg-tmp/rbf/sputils.cpython-37m-x86_64-linux-gnu.so)

Do you have an idea why it happens?

treverhines commented 2 years ago

Are you starting python from inside the rbf package directory? If you do that, then python tries to import rbf from the current directory, which does not contain the compiled cython files, rather than the installed rbf package.

CsatiZoltan commented 2 years ago

No, I start Python it from an unrelated directory. When I start it from the directory built during python setup.py install, it can import.

zyhgoon commented 2 years ago

这个代码为什么不能在Windows系统中下载的pycharm中运行?最后下载完requestments中所有需要的包,但是在运行的的过程中提示错误:没有rbf.poly模块,我感觉是因为在test里面有一个poly.c文件和poly.pyx文件,就是没有转化成为poly.py文件。针对这个问题我下载cpython包后还是无法转换成py文件,然后就不知道怎么去操作了?各位大神,可以帮我解决这个问题吗?(期待解决)

zyhgoon commented 2 years ago

No module named 'rbf.poly'

zyhgoon commented 2 years ago

问题就是上面这个