Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'wrap_train' is not defined : somoclu Version: 1.7.5 in windows #144

Open
hanzigs opened this issue Aug 1, 2019 · 18 comments

Comments

@hanzigs
Copy link

hanzigs commented Aug 1, 2019

Hi,
I am getting the error which I can see the different issues for the same in discussions dating back from 2016,

som_clu.train()
Traceback (most recent call last):

  File "<ipython-input-196-fe94f553b2c4>", line 1, in <module>
    som_clu.train()

  File "C:\ProgramData\Anaconda3\lib\site-packages\somoclu\train.py", line 222, in train
    wrap_train(np.ravel(self._data), epochs, self._n_columns, self._n_rows,

NameError: name 'wrap_train' is not defined
import somoclu
Warning: the binary library cannot be imported. You cannot train maps, but you can load and analyze ones that you have already saved.
If you installed Somoclu with pip on Windows, this typically means missing DLLs. Please refer to the documentation.

may i know the correct solutions please?
I am using windows, in Anaconda spyder IDE
Thanks

@xgdgsc
Copy link
Collaborator

xgdgsc commented Aug 1, 2019

Have you tried some solutions from #28 ?

@hanzigs
Copy link
Author

hanzigs commented Aug 1, 2019

so I can't see _somoclu_wrap.pyd in site-packages
also vcomp90.dll, msvcp90.dll, msvcr90.dll to be copied to C:\Windows\SysWOW64, i downloaded that from the dll sites, not sure about which versions

image

@hanzigs
Copy link
Author

hanzigs commented Aug 5, 2019

Hi @xgdgsc , May I know any suggestions available please?

@sahautal
Copy link

I'm having the same issue with Python version 3.7.4 and Somoclu version 1.7.5 . Somoclu 1.7.5 works fine with python 3.6, but with python 3.7.4 I get the same errors as you. However Somoclu version 1.7.4 works fine on python 3.7.4

@hanzigs
Copy link
Author

hanzigs commented Aug 16, 2019

Thanks @sahautal, I have Python 3.7.0, somoclu 1.7.4 worked.

@mtcarvalho
Copy link

Python 3.7.4 or 3.7.0 with Somoclu 1.7.4 didnt work for me, neither Python 3.6 with Somoclu 1.7.5 :(

thompsonsed added a commit to thompsonsed/somoclu that referenced this issue Oct 2, 2019
Modified the setup process in Python
Possible fix for peterwittek#144
@Guilherme-B
Copy link

I'm having the exact same problem. Tried manually setting the ddls, nothing. I tried downgrading versions and still. with 3.7+ nothing works. Same behavior on 3.8.2.

@xgdgsc
Copy link
Collaborator

xgdgsc commented Apr 25, 2020

I uploaded https://files.pythonhosted.org/packages/bf/1d/8f2a89cd9a0f37fe3a8ba114f43e310a832f5f30f7f3d886e6379ab2e722/somoclu-1.7.5.1.tar.gz . You can try run python setup.py install after extracting. Before that you should install visual studio with visual c++ compilers. From my testing it works.

@pedromaiapatinha
Copy link

pedromaiapatinha commented May 1, 2020

Hey,
I'm having the same problem here, NameError: name 'wrap_train' is not defined.

  • I'm using the somoclu version 1.7.5.1 (already tried 1.7.4 and 1.7.5);
  • Already ran python setup.py install successfuly;
  • Already installed libiomp5md, msvcp90, msvcr90 and vcomp90;
  • Also, I have visual studio with visual c++ compilers.
Warning: passing the data in the constructor is deprecated.
Warning: data was not float32. A 32-bit copy was made
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<timed eval> in <module>

~\Anaconda3\lib\site-packages\somoclu\train.py in train(self, data, epochs, radius0, radiusN, radiuscooling, scale0, scaleN, scalecooling)
    220         self.umatrix.shape = (self._n_rows * self._n_columns, )
    221         self.bmus.shape = (self.n_vectors * 2, )
--> 222         wrap_train(np.ravel(self._data), epochs, self._n_columns, self._n_rows,
    223                    self.n_dim, self.n_vectors, radius0, radiusN,
    224                    radiuscooling, scale0, scaleN, scalecooling,

NameError: name 'wrap_train' is not defined

Any ideia? Thank you

@xgdgsc
Copy link
Collaborator

xgdgsc commented May 15, 2020

Which version of VS? I only tested latest .

@guba-odudkin
Copy link

@xgdgsc @pedromaiapatinha Any update on this? Still an issue for me. Everything is latest. I only got as far as figuring out that setup.py fails to compile with error code 2. But it doesn't fail the process, so unless you scroll up you won't know it failed, it reports that install was successful. As the result _somoclu_wrap.pyd isn't getting created and I get the above error.
Thanks in advance for any tips towards a solution.

@rodiegeology
Copy link

rodiegeology commented Mar 15, 2021

It worked for me using this solution (https://www.scivision.dev/python-windows-visual-c-14-required) for installing the 1.7.5.1 version, the error does not appear anymore. However my Jupyter Notebook kernel dies everytime I try to train data, even small datasets. Windows 10 64 bits, Anaconda 3, Python 3.8.

image

@xgdgsc @pedromaiapatinha Any update on this? Still an issue for me. Everything is latest. I only got as far as figuring out that setup.py fails to compile with error code 2. But it doesn't fail the process, so unless you scroll up you won't know it failed, it reports that install was successful. As the result _somoclu_wrap.pyd isn't getting created and I get the above error.
Thanks in advance for any tips towards a solution.

@helt
Copy link

helt commented Mar 24, 2021

I run ito the same issue as @rodiegeology . I also tried to run it in python directly, but the result remains the same: The python interpreter dies.

Do I understand correctly that - to get somoclu up and running on windows - I have to have Visual Studio? Visual Studio Build Tools are not sufficient for this task?

@maxwest-uw
Copy link

maxwest-uw commented Feb 13, 2023

Hi, I'm having this same error with somoclu but with a Macbook M1 pro, I see that the 1.7.5.1 change above is pushed to pypi but it fails to actually build locally:

Discarding https://files.pythonhosted.org/packages/bf/1d/8f2a89cd9a0f37fe3a8ba114f43e310a832f5f30f7f3d886e6379ab2e722/somoclu-1.7.5.1.tar.gz (from https://pypi.org/simple/somoclu/): Requested somoclu from file:///Users/maxwest/Library/Caches/pip/wheels/47/89/ab/0932352d0a0a8ceebb91b937bd4de854ec6927f4ab6c78b7b4/somoclu-1.7.5-py3-none-any.whl has inconsistent version: expected '1.7.5.1', but metadata has '1.7.5'

@xgdgsc
Copy link
Collaborator

xgdgsc commented Feb 18, 2023

Uploaded src package 1.7.6 to pypi.

@xgdgsc
Copy link
Collaborator

xgdgsc commented Feb 20, 2023

Conda updated with M1 build, please test if you have a M1 device.

@vkresch
Copy link

vkresch commented May 19, 2024

Any updates on this issue? Have the same issue in Ubuntu 20.04. How can I resolve this? I am using somoclu==1.7.6 in an virtual environment. cc @peterwittek

@vkresch
Copy link

vkresch commented May 19, 2024

Solved with:
pip install -U numpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants