danielfrg / word2vec

Python interface to Google word2vec
Apache License 2.0
2.57k stars 631 forks source link

Not working #36

Closed lucasrodes closed 6 years ago

lucasrodes commented 8 years ago

Hi, I am using Mac OS X El Capitan and I am having difficulties to run the code from http://nbviewer.jupyter.org/github/danielfrg/word2vec/blob/master/examples/word2vec.ipynb. In particular this is what I get:

$ python
Python 2.7.10 (default, Oct 23 2015, 18:05:06) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import word2vec
>>> word2vec.word2phrase('text8', 'text-phrases', verbose=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "word2vec/scripts_interface.py", line 110, in word2phrase
    run_cmd(command, verbose=verbose)
  File "word2vec/scripts_interface.py", line 142, in run_cmd
    stderr=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Does anyone know what's going on?

celestesosmart commented 8 years ago

I've got the same error. and I have use os.chdir to change my working path but seems doesn't work.

vwoloszyn commented 8 years ago

I have the same problem. Did you solve this? Thanks!

a455bcd9 commented 8 years ago

I have the same problem, with python2 and python3 on Ubuntu 14.04 (on my own computer and on AWS EC2).

lcheng15 commented 7 years ago

I have the same error, Python 2.7 on MacOS Sierra

Fangwq commented 7 years ago

I have the same error, too, Python 2.7.10 on MacOS Sierra.

Fangwq commented 7 years ago

I handle this problem already. The reason is that it lack the executable word2vec file in your system or the environment variable doesn’t include the path of executable word2vec file. And if you use the default python in system, the problem will happen. The solution is that: dowload the word2vec package, run sudo python setup.py install, then the bin directory appears. However the excutable file in bin can’t be copy to the system directory(/System/Library/Frameworks/Python.framework/Versions/2.7/bin). So you can copy the file to a directory and set the environment variable.

The above solution is for default python. Of cource, using the python with virtual evironment or anaconda will kill your time. I hope it will help you

kika-nipeng commented 7 years ago

what does "set the environment variable."mean ? thanks @Fangwq

Fangwq commented 7 years ago

It means that you specify the executable file in .bash_profile. You can check it on website for more details @kika-nipeng.

saurabhvyas commented 7 years ago

i have got the exact same problem