lukasschwab / stackit

StackOverflow queries from the command line
MIT License
314 stars 28 forks source link

Trackeback pkg problem #1

Closed lbarberiscanoni closed 9 years ago

lbarberiscanoni commented 9 years ago

I'll start by saying that this is awesome, and I love you guys for doing this.

I used the sudo pip install stackit command on my term (I use Iterm2 on a Mac that contains both Python2.7 and Python3.3) and it shows that everything was downloaded correctly, but when I try using it I get this:

Traceback (most recent call last): File "/usr/local/bin/stackit", line 5, in from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in working_set.require(requires) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: requests

Any idea as to why I get this reaction?

Thank you so much again for making this XD

lukasschwab commented 9 years ago

@lbarberiscanoni Hmmm...

I attempted to recreate your error––I use stock Terminal on a OSX with Python 2.6 and 2.7 installed. This is what I ran:

$ sudo pip uninstall requests
$ sudo pip uninstall stackit
$ sudo pip install stackit

During the stackit installation process, pip prints Downloading/unpacking requests (from stackit) Downloading requests-2.5.1-py2.py3-none-any.whl (464kB): 464kB downloaded––a successful download.

I suspect that your error might be a problem with Python3.3. We developed with Python2.7 in mind, so perhaps you're seeing errors because your default python version is different?

I'm still surprised, considering requests appears to support Python3.3. Have you tried to run sudo pip install requests separately from the stackit install sequence?

Leaving this open! Hopefully we can help you fix this.

lbarberiscanoni commented 9 years ago

Hey Lukas,

The issue persists :( I tried both pip installing requests separately and just redoing stackit.

The unpacking of requests and the download works too which is what makes it weirder.

I use homebrew as my package manager, is that the problem maybe?

lukasschwab commented 9 years ago

I don't think your package manager should be an issue––pip is the package manager you're using to install the requests package.

You should be able to see what version of Python you run by default by simply entering python at the command line and checking the little blurb that shows up––e.g. Python 2.7.6 (default, Sep 9 2014, 15:04:36) indicates I'm running 2.7 by default.

The Python version you installed with Homebrew might not be your default; check out this StackOverflow to be sure you're using the version you intend.

lbarberiscanoni commented 9 years ago

I have python 2.7.5 as default

And if I run python in the terminal I get this:

Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin

WnP commented 9 years ago

@lukasschwab try easy_install --upgrade requests

lukasschwab commented 9 years ago

Thanks! @lbarberiscanoni give @WnP's solution a go!

Edit: I'd test it myself, but I'm having trouble replicating the problem.

lbarberiscanoni commented 9 years ago

Thank you lukassschwab! It solved the issue, kind of...

Now the terminal recognizes stackit as a command, however I get a new error message:

Traceback (most recent call last): File "/usr/local/bin/stackit", line 9, in load_entry_point('stackit==0.1.3', 'console_scripts', 'stackit')() File "/usr/local/lib/python2.7/site-packages/stackit/stackit_core.py", line 197, in main searchTerm(term, tags) File "/usr/local/lib/python2.7/site-packages/stackit/stackit_core.py", line 92, in searchTerm questions = so.search_advanced(q = term, tagged = tags, sort = Sort.Votes) AttributeError: 'Site' object has no attribute 'search_advanced'

WnP commented 9 years ago

@lbarberiscanoni seems related to #2

lbarberiscanoni commented 9 years ago

Right, I just noticed that XD

lukasschwab commented 9 years ago

Well, if those two solutions work for you, I'm calling this thread closed!