Giter Site home page Giter Site logo

Comments (13)

gfairchild avatar gfairchild commented on May 19, 2024 1

1.5.2 was just released, which further addresses the NumPy dependency issue. I think this should solve your problem. I'm going to go ahead and close this issue, but please let me know if you're still experiencing this problem with 1.5.2.

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

How did you install it? Did the pip install succeed? I haven't actually tried installing this on Windows 10 except for within the bash subsystem (which does work).

from pyxdameraulevenshtein.

funkindy avatar funkindy commented on May 19, 2024

I have installed it vie pip as the dependency of textdistance package (i opened an issue there but they forwarded me here). So i just did this:

pip install textdistance[extras]

to install. And it succeded.

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

Can you try installing pyxdameraulevenshtein by itself using pip and let me know if that works?

from pyxdameraulevenshtein.

funkindy avatar funkindy commented on May 19, 2024

Same crash on import after pip install pyxdameraulevenshtein on clean venv.

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

Would you mind creating a fresh virtual environment and installing with the following command?:

pip install --verbose pyxdameraulevenshtein

Please paste the contents of that output here so that I can get a little more insight into what's going on.

from pyxdameraulevenshtein.

funkindy avatar funkindy commented on May 19, 2024

@gfairchild i created fresh venv and installed with --verbose. Got this suspicious error:

--- Logging error ---
Traceback (most recent call last):
File "c:\users\user\anaconda3\Lib\logging_init_.py", line 983, in emit
stream.write(self.terminator)
File "c:\users\user\envs\new\lib\site-packages\pip_vendor\colorama\ansitowin32.py", line 141, in write
self.write_and_convert(text)
File "c:\users\user\envs\new\lib\site-packages\pip_vendor\colorama\ansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "c:\users\user\envs\new\lib\site-packages\pip_vendor\colorama\ansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
OSError: raw write() returned invalid length 4 (should have been between 0 and 2)
Call stack:
File "c:\users\user\anaconda3\Lib\runpy.py", line 184, in run_module_as_main
"main", mod_spec)
File "c:\users\user\anaconda3\Lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\user\Envs\new\Scripts\pip.exe_main
.py", line 9, in
sys.exit(main())
File "c:\users\user\envs\new\lib\site-packages\pip_init
.py", line 248, in main
return command.main(cmd_args)
File "c:\users\user\envs\new\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\users\user\envs\new\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\users\user\envs\new\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\users\user\envs\new\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\users\user\envs\new\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\users\user\envs\new\lib\site-packages\pip\wheel.py", line 273, in move_wheel_files
logger.debug(stdout.getvalue())
Message: ''
Arguments: ()

But afterall "Successfully installed numpy-1.14.2 pyxdameraulevenshtein-1.5".

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

Is that the complete output of pip install?

Ok, so from what I can tell right now, it looks like the error is in the installation, not the use, of pyxdameraulevenshtein. We need to figure out how to be able to get you to install this on Windows. As indicated on the readme, you need to be able to compile C code. On Linux/Macs, this is easy. Using the Bash subsystem on Windows (which I'd highly recommend checking out if you haven't already), this is easy. I've never tried it on native Windows, though. Additionally, it looks like you're using Anaconda, which I've also never used, so I'm not sure how that affects things.

https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.0_standalone:_Build_Tools_for_Visual_Studio_2017_.28x86.2C_x64.2C_ARM.2C_ARM64.29 may be a good place to start. So, as those instructions say, try this:

  1. Install Microsoft Build Tools for Visual Studio 2017.
  2. pip install --upgrade setuptools
  3. pip install --verbose pyxdameraulevenshtein

Let me know if that solves your problem.

from pyxdameraulevenshtein.

funkindy avatar funkindy commented on May 19, 2024

After i cloned the repo and installed from source (python setup.py install) i now get all the things work good. Also there is no crash on import pyxdameraulevenshtein as well. It is good in both clean venv and any existing venv as well.

So maybe the bug is somewhere in pypi version difference?

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

That's certainly interesting. The PyPI version is identical to master right now. Nothing has changed. So after trying what I just suggested, you still can't install from PyPI?

from pyxdameraulevenshtein.

funkindy avatar funkindy commented on May 19, 2024

New scenario appeared:

  1. I cleaned up all the pip cache
  2. pip install --verbose pyxdameraulevenshtein. Full log of this is attached. But this time numpy was not installed as a dependency. So after import pyxdameraulevenshtein i just got ImportError: no module called numpy
  3. pip install numpy v1.14.2 is installed.
  4. Now everything works good.

So if my cached numpy was broken i dont get why installing pyxdameraulevenshtein from source didnt cause the issue.

install_log.txt

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

Very interesting. NumPy should automatically be installed, but that's clearly not the case. In fact, I just tried it on an empty virtual environment on my PC (using the Ubuntu subsystem on Windows 10), and I can replicate what you're referring to.

I need to fix setup.py so that NumPy is properly installed by pip if it's not already there. I'm currently essentially doing what https://stackoverflow.com/a/21621689/1269634 suggests, but that's clearly not working.

from pyxdameraulevenshtein.

gfairchild avatar gfairchild commented on May 19, 2024

I just modified setup.py a bit to actually remove some NumPy-related code that seemed to be causing various issues. I've made the decision to expect the user to explicitly install NumPy prior to installing this library. 1.5.1 is now live on PyPI. I think this will fix your issue. Can you try and let me know?

from pyxdameraulevenshtein.

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.