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

since 0.7.1 having trouble with the package #35

Closed
darenr opened this issue Oct 16, 2013 · 11 comments
Closed

since 0.7.1 having trouble with the package #35

darenr opened this issue Oct 16, 2013 · 11 comments

Comments

@darenr
Copy link

darenr commented Oct 16, 2013

On both my mac and linux machines I have the same problem with 0.7.1

from text.blob import TextBlob
Traceback (most recent call last):
File "", line 1, in
File "text.py", line 5, in
from text.blob import TextBlob
ImportError: No module named blob

my sys.path does not contain the textblob module

import sys
for p in sys.path:
... print p
...

/Library/Python/2.7/site-packages/ipython-2.0.0_dev-py2.7.egg
/Library/Python/2.7/site-packages/matplotlib-1.3.0-py2.7-macosx-10.8-intel.egg
/Library/Python/2.7/site-packages/numpy-1.9.0.dev_fde3dee-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/pandas-0.12.0_485_g02612c3-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/pymc-2.3a-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/scikit_learn-0.14_git-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/scipy-0.14.0.dev_4938da3-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/statsmodels-0.6.0-py2.7-macosx-10.8-x86_64.egg
/Library/Python/2.7/site-packages/readline-6.2.4.1-py2.7-macosx-10.7-intel.egg
/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg
/Library/Python/2.7/site-packages/six-1.4.1-py2.7.egg
/Library/Python/2.7/site-packages/pyparsing-1.5.7-py2.7.egg
/Library/Python/2.7/site-packages/pytz-2013.7-py2.7.egg
/Library/Python/2.7/site-packages/pyzmq-13.1.0-py2.7-macosx-10.6-intel.egg
/Library/Python/2.7/site-packages/pika-0.9.13-py2.7.egg
/Library/Python/2.7/site-packages/Jinja2-2.7.1-py2.7.egg
/Library/Python/2.7/site-packages/MarkupSafe-0.18-py2.7-macosx-10.8-intel.egg
/Library/Python/2.7/site-packages/patsy-0.2.1-py2.7.egg
/Library/Python/2.7/site-packages/Pygments-1.6-py2.7.egg
/Library/Python/2.7/site-packages/Sphinx-1.2b3-py2.7.egg
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
/Library/Python/2.7/site-packages

despite it being there. I have uninstalled and reinstalled and tried all sorts of things:

mbpdar:deaas daren$ ls /Library/Python/2.7/site-packages/te*
/Library/Python/2.7/site-packages/text:
/Library/Python/2.7/site-packages/textblob-0.7.1-py2.7.egg-info:

I've verified the init.py doesn't have odd characters. if I change to the /Library/Python/2.7/site-packages/text folder I am able to import:

mbpdar:deaas daren$ cd /Library/Python/2.7/site-packages/text
mbpdar:text daren$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from text.blob import TextBlob

I cannot figure out what changed that might cause this.

Thanks in advance
Daren

@sloria
Copy link
Owner

sloria commented Oct 16, 2013

Hi Daren,

Can you try running which python in your shell?

It appears that you have two python installations on your system. I think what might be happening is that one of your installations has TextBlob and the other does not. When you run the python shell, it uses the python that does not have TextBlob.

@darenr
Copy link
Author

darenr commented Oct 16, 2013

I think I am running the right version of python

mbpdar:deaas daren$ which python
/usr/bin/python

even if I run

Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from text.blob import TextBlob
Traceback (most recent call last):
File "", line 1, in
File "text.py", line 5, in
from text.blob import TextBlob
ImportError: No module named blob

I get the same error and it's 2.7.2 version that's being run. The other
packages in my site-packages are being loaded, there's just something
special about TextBlob. I checked it's not file permissions already and
this worked in 0.7.0. I've wracked my brains as to what this might be. If i
run python -v I see

import readline # dynamically loaded from
/Library/Python/2.7/site-packages/readline-6.2.4.1-py2.7-macosx-10.7-intel.egg/readline.so

and so on, so other eggs are getting read from the right location.
/Library/Python/2.7/site-packages is where my textblob egg is. This
happened at the same time on both my laptop (mac) and linux work desktop,
so it appears not to be machine type specific.

On Tue, Oct 15, 2013 at 9:15 PM, Steven Loria notifications@github.comwrote:

Hi Daren,

Can you try running which python in your shell?

It appears that you have two python installations on your system. I think
what might be happening is that one of your installations has TextBlob and
the other does not. When you run the python shell, it uses the python
that does not have TextBlob.


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-26391787
.

@sloria
Copy link
Owner

sloria commented Oct 16, 2013

Do you get the same result when installing TextBlob in a virtualenv?

Also, try running python -v -c "import text"

You should see something similar to this

import text # directory /usr/local/lib/python2.7/site-packages/text
# /usr/local/lib/python2.7/site-packages/text/__init__.pyc matches /usr/local/lib/python2.7/site-packages/text/__init__.py
import text # precompiled from /usr/local/lib/python2.7/site-packages/text/__init__.pyc

somewhere in the output

@darenr
Copy link
Author

darenr commented Oct 16, 2013

yes. I just installed a brand new virtual box, ubuntu 13.04, I added curl
and setuptools, then pip, then installed textbob and...

ubuntu@ubuntu-VirtualBox:~/Dropbox/deaas$ python
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from text.blob import TextBlob
Traceback (most recent call last):
File "", line 1, in
File "text.py", line 5, in
from text.blob import TextBlob
ImportError: No module named blob

On Tue, Oct 15, 2013 at 9:35 PM, Steven Loria notifications@github.comwrote:

Do you get the same result when installing TextBlob in a virtualenv?


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-26392360
.

@sloria
Copy link
Owner

sloria commented Oct 16, 2013

That is strange. I will try to reproduce this on another machine within the next few days. Does this happen with any of your other installed packages?

@darenr
Copy link
Author

darenr commented Oct 16, 2013

thanks,I appreciate it. I don't see this with other packages.

On Tue, Oct 15, 2013 at 11:13 PM, Steven Loria notifications@github.comwrote:

That is strange. I will try to reproduce this on another machine within
the next few days. Does this happen with any of your other installed
packages?


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-26395039
.

@sloria
Copy link
Owner

sloria commented Oct 16, 2013

Also, do you get the same error if you uninstall 0.7.1 then install 0.7.0?

@darenr
Copy link
Author

darenr commented Oct 16, 2013

I just tried this on the virtualbox vm and that too didn't work. Same
error. I verified that in my python2.7 dist-packages folder there is
PyYAML, textblob...egg-info, text and yaml, but even 0.7.0 doesn't work.
Since it was working maybe something was removed? Where I've seen this in
the past is the text folder not having, or have a "corrupt" init.py,
but I don't see anything wrong at all. Am I the only one having this
problem? If so you could close it and I'll just have to figure it out, but
I wonder if I am the only one since a brand new vm exhibits the same
problem, as well as two other machines, it seems unlikely that it's
dependent on my specific setup.

On Wed, Oct 16, 2013 at 8:37 AM, Steven Loria notifications@github.comwrote:

Also, do you get the same error if you uninstall 0.7.1 then install 0.7.0?


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-26429341
.

@sloria
Copy link
Owner

sloria commented Oct 16, 2013

I just tried installing textblob 0.7.1 on three different machines that were immediately available: Mac OS 10.7 with Python 2.7.5, Mac OSX 10.8 with Python 2.7.2, and Red Hat Linux with Python 2.6.2. I did not see the error at all. This will be difficult to diagnose without being able to reproduce the problem. I will keep the issue open for now and will continue trying to reproduce it. Please let me know if you make any progress.

@darenr
Copy link
Author

darenr commented Oct 17, 2013

thank Steven, I just found the problem, and it was my fault. I had at some
point created a file called text.py, even though I renamed it the .pyc
remained and this caused the search path to fail to find your packages. I
shouldn't have named my source file text.py, but it may also make sense to
rename your package to something less likely to clash, maybe "blobtext",
either way it's my fault and sorted out now.

On Wed, Oct 16, 2013 at 2:22 PM, Steven Loria notifications@github.comwrote:

I just tried installing textblob 0.7.1 on three different machines that
were immediately available: Mac OS 10.7 with Python 2.7.5, Mac OSX 10.8
with Python 2.7.2, and Red Hat Linux with Python 2.6.2. I did not see the
error at all. This will be difficult to diagnose without being able to
reproduce the problem. I will keep the issue open for now and will continue
trying to reproduce it. Please let me know if you make any progress.


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-26459870
.

@sloria
Copy link
Owner

sloria commented Oct 18, 2013

OK, good to hear you found the problem. You are correct that text is not a very good namespace. I will likely change this in 1.0.

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

2 participants