I installed rosetta, and tried the run examples/plot_classifiers.py
- got:
/usr/local/lib/python3.4/site-packages/rosetta/text/streamers.py in <module>()
10 import os
11 from scipy import sparse
---> 12 import MySQLdb
13 import MySQLdb.cursors
14 import pymongo
ImportError: No module named 'MySQLdb'
^ This isn't listed as a dependency on the readme. Should it be ?
Futhermore, it wasn't installed when I used pip to install rosetta.
>>> import rosetta
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "rosetta/__init__.py", line 1, in <module>
from rosetta.text.api import *
File "rosetta/text/api.py", line 1, in <module>
from rosetta.text.streamers import TextFileStreamer
File "rosetta/text/streamers.py", line 20, in <module>
import pymongo
ImportError: No module named pymongo
Pymongo too.
>>> import rosetta
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aljohnson/code/rosetta/rosetta/__init__.py", line 1, in <module>
from rosetta.text.api import *
File "/Users/aljohnson/code/rosetta/rosetta/text/api.py", line 1, in <module>
from rosetta.text.streamers import TextFileStreamer
File "/Users/aljohnson/code/rosetta/rosetta/text/streamers.py", line 22, in <module>
from rosetta.parallel.parallel_easy import imap_easy, parallel_apply
File "/Users/aljohnson/code/rosetta/rosetta/parallel/parallel_easy.py", line 13, in <module>
import cPickle
ImportError: No module named 'cPickle'
cPickle too...
The weird thing... is that I'm seeing all these listed in the requirements.txt. So at this point I'm like wtf I'm just going to use virtual env.
aljohnson@xander-splunk :
~/code/rosetta
$ virtualenv -p `which python` rosetta_env/
Running virtualenv with interpreter /usr/bin/python
New python executable in rosetta_env/bin/python
Installing setuptools, pip, wheel...done.
aljohnson@xander-splunk :
~/code/rosetta
$ source rosetta_env/bin/activate
(rosetta_env)
aljohnson@xander-splunk :
~/code/rosetta
$ ls
CONTRIBUTING.md MANIFEST.in README_data.md examples notebooks requirements.txt rosetta_env setup.py
LICENSE.txt README.md docs makefile notes rosetta scripts
(rosetta_env)
aljohnson@xander-splunk :
~/code/rosetta
$ pip install -r requirements.txt
/Users/aljohnson/code/rosetta/rosetta_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting pandas (from -r requirements.txt (line 1))
/Users/aljohnson/code/rosetta/rosetta_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading pandas-0.16.2-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (7.3MB)
100% |████████████████████████████████| 7.3MB 77kB/s
Collecting scikit-learn (from -r requirements.txt (line 2))
Downloading scikit_learn-0.16.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (5.4MB)
100% |████████████████████████████████| 5.4MB 106kB/s
Collecting statsmodels (from -r requirements.txt (line 3))
Downloading statsmodels-0.6.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.0MB)
100% |████████████████████████████████| 4.0MB 73kB/s
Collecting gensim (from -r requirements.txt (line 4))
Using cached gensim-0.12.1.tar.gz
Collecting docx (from -r requirements.txt (line 5))
Using cached docx-0.2.4.tar.gz
Collecting pyth (from -r requirements.txt (line 6))
Using cached pyth-0.6.0.tar.gz
Collecting pymongo (from -r requirements.txt (line 7))
/Users/aljohnson/code/rosetta/rosetta_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading pymongo-3.0.3-cp27-none-macosx_10_8_intel.whl (239kB)
100% |████████████████████████████████| 241kB 2.0MB/s
Collecting MySQL-python (from -r requirements.txt (line 8))
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/vj/_mcyrpkn30d2tph7c56yvzxxf5_jlv/T/pip-build-ylIxmf/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/vj/_mcyrpkn30d2tph7c56yvzxxf5_jlv/T/pip-build-ylIxmf/MySQL-python
(rosetta_env)
At this point I'm not sure what the hell is going on. Its probably my fault in the end but, essentially, this is seeming a lot harder than it should be. Just to import rosetta
.