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

Issue with pip install -r requirements.txt #4

Open
melnarte opened this issue Jun 19, 2018 · 2 comments
Open

Issue with pip install -r requirements.txt #4

melnarte opened this issue Jun 19, 2018 · 2 comments

Comments

@melnarte
Copy link

Hello,

I have tried to execute: 'pip install -r requirements.txt'
The error is

Could not find a version that satisfies the requirement bonjour-py==0.3 (from -r requirements.txt (line 5)) (from versions: )
No matching distribution found for bonjour-py==0.3 (from -r requirements.txt (line 5))

How to proceed to fix it?

@philgooch
Copy link

philgooch commented Aug 7, 2018

I installed it from here:

pip install https://opensource.apple.com/source/python_modules/python_modules-21/bonjour-py/bonjour-py-0.3.tar.gz

You may need to install swig first: OS X:

brew install swig

or Linux:

sudo apt-get install swig

If you can a strange XCode warning, see here for the solution: nodejs/node-gyp#569

On Ubuntu I got an error about a missing dns_sd.h file when installing bonjour, but this was fixed with

sudo apt-get install libavahi-compat-libdnssd-dev

(see https://stackoverflow.com/questions/19585117/error-dns-sd-h-no-such-file-or-directory)

Hmm, seems this project needs more work to run on Linux, as it seems OS X only at present:

You're not running on MacOS X, and don't use GNUstep
    I don't know how to build PyObjC on such a platform.
    Please read the ReadMe.
    
    ObjC runtime not found

The original requirements.txt is frozen at specific versions, but some of these seem to be incompatible with each other.

Here's a requirements.txt that allowed me to install and run this project on Ubuntu, with all the OSX specific libraries removed:

altgraph
backports-abc
bdist-mpkg
beautifulsoup4
boto
breadability
bz2file
certifi
chardet
Cython
dill
docopt
funcsigs
gensim
joblib
lxml
macholib
matplotlib
mock
modulegraph
nltk
nose
numpy
pandas
pbr
protobuf
py2app
pyparsing
python-dateutil
pytz
requests
scikit-learn
scipy
singledispatch
six
smart-open
sumy
tensorflow
tornado
ujson
virtualenv
xattr
zope.interface

You will also need to modify the sys.path.insert in each file that it occurs (change it to the current working directory) and also remove the Dev. prefix before some import statements.

Now to try and acquire the data ...

@yyccnn
Copy link

yyccnn commented Sep 30, 2018

Thanks @philgooch

For potential readers passing by, I was able to correct the sys.path.insert and Dev. issues with the following one-liner:

find . -type f -exec sed -i 's+/Users/edcollins/Documents/CS/4thYearProject/Code+/path/to/current/working/directory+g' {} + && find . -type f -exec sed -i 's+from\ Dev\.+from\ +g' {} +

(Just in case it needs to be said, replace /path/to/current/working/directory with your current working directory before running this command, escaping any special character with \)

Then there was still one last line in ./Word2Vec/paper_word2vec.py that needed to have the line from Dev import DataTools changed to import DataTools.

Now on to try out this project!

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

3 participants