Coder Social home page Coder Social logo

Comments (18)

jamesturk avatar jamesturk commented on August 15, 2024

Are you working from within your virtualenv? I'm not sure how virtualenv works on windows, but you should have run an activate step?

When you import scrapelib what does scrapelib.version print as?

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

Ah... i hadn't yesterday. Since then I've

  • uninstalled scrapelib globally and from the project virtualenv
  • reinstalled scrapelib in the virtualenv

At /env/Scripts I can see:

  • scrapeshell
  • scrapeshell.exe.manifest
  • scrapeshell-script

When I check which python I get:
$ which python
/cygdrive/c/Users/natalie/Documents/Encore-in-Google/env/Scripts/python
(env)

But when I check which scrapelib I get:
$ which scrapelib
which: no scrapelib in (/cygdrive/c/Users/natalie/Documents/Encore-in-Google/env/Scripts:/usr/local/bin:/usr/bin:/cygdrive/c/Python34:/cygdrive/c/Python34/Scripts:/cygdrive/c/Program Files/Broadcom/Broadcom 802.11 Network Adapter/Driver:/cygdrive/c/Program Files (x86)/AMD APP/bin/x86_64:/cygdrive/c/Program Files (x86)/AMD APP/bin/x86:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/Lenovo/Bluetooth Software:/cygdrive/c/Program Files/Lenovo/Bluetooth Software/syswow64:/cygdrive/c/Program Files (x86)/nodejs:/cygdrive/c/Users/natalie/AppData/Roaming/npm)
(env)

In IDLE when I run:
import scrapelib
print (scrapelib.version)

I get:
Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 1, in
import scrapelib
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3, in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'

I'm not why I can see some scrapelib (scrapeshell) files in env/Scripts, but cannot use scrapelib.

Thanks,

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

can you try printing scrapelib.__version__ with the double underscores

On Wed, Jun 25, 2014 at 3:41 PM, pollecuttn [email protected]
wrote:

Ah... i hadn't yesterday. Since then I've

  • uninstalled scrapelib globally and from the project virtualenv
  • reinstalled scrapelib in the virtualenv

At /env/Scripts I can see:

  • scrapeshell
  • scrapeshell.exe.manifest
  • scrapeshell-script

When I check which python I get:
$ which python
/cygdrive/c/Users/natalie/Documents/Encore-in-Google/env/Scripts/python
(env)

But when I check which scrapelib I get:
$ which scrapelib
which: no scrapelib in
(/cygdrive/c/Users/natalie/Documents/Encore-in-Google/env/Scripts:/usr/local/bin:/usr/bin:/cygdrive/c/Python34:/cygdrive/c/Python34/Scripts:/cygdrive/c/Program
Files/Broadcom/Broadcom 802.11 Network Adapter/Driver:/cygdrive/c/Program
Files (x86)/AMD APP/bin/x86_64:/cygdrive/c/Program Files (x86)/AMD
APP/bin/x86:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program
Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program
Files/Lenovo/Bluetooth Software:/cygdrive/c/Program Files/Lenovo/Bluetooth
Software/syswow64:/cygdrive/c/Program Files
(x86)/nodejs:/cygdrive/c/Users/natalie/AppData/Roaming/npm)
(env)

In IDLE when I run:
import scrapelib
print (scrapelib.version)

I get:

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 1,
in
import scrapelib
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3,
in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'

I'm not why I can see some scrapelib (scrapeshell) files in env/Scripts,
but cannot use scrapelib.

Thanks,


Reply to this email directly or view it on GitHub
#19 (comment)
.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 1, in
import scrapelib
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3, in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 1, in
import scrapelib
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3, in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

very strange- i'd recommend uninstalling & reinstalling scrapelib. are other python libraries working in your environment? is requests?

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

It doesn't come out in the comment formatting, but I do have the double underscores...

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

can you rename your file something other than scrapelib? that is likely the culprit (thanks @paultag!)

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

I uninstalled and reinstalled scrapelib before I commented today.

I can use requests but when I do which requests I get a similar message to the one for scrapelib, whether i have my virtualenv activated or not. I don't know how that's possible.

import requests
r = requests.get('http://google.com')
print (r.status_code)

gives:
200

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

Have you tried renaming your script scrapelib.py to something else, perhaps
scrapetest.py -- the issue is probably that it is trying to import itself

On Wed, Jun 25, 2014 at 6:11 PM, pollecuttn [email protected]
wrote:

I uninstalled and reinstalled scrapelib before I commented today.

I can use requests but when I do which requests I get a similar message to
the one for scrapelib, whether i have my virtualenv activated or not. I
don't know how that's possible.

import requests
r = requests.get('http://google.com')
print (r.status_code)

gives:
200


Reply to this email directly or view it on GitHub
#19 (comment)
.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

File renamed scraplib-test.py:
Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib-test.py", line 1, in
import scrapelib
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3, in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

You still have a scrapelib.py in that directory, try removing it.

On Wed, Jun 25, 2014 at 6:14 PM, pollecuttn [email protected]
wrote:

File renamed scraplib-test.py:

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib-test.py", line
1, in
import scrapelib

File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib.py", line 3,
in
print (scrapelib.version)
AttributeError: 'module' object has no attribute 'version'


Reply to this email directly or view it on GitHub
#19 (comment)
.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib-test.py", line 1, in
import scrapelib
ImportError: No module named 'scrapelib'

At least it's a different message...

So is it telling me I don't have scrapelib? I just tried uninstalling and reinstalling scrapelib again, in my virtualenv, and I'm still getting the same ImportError: No module named 'scrapelib'.

I can still see these in env/Scripts:
scrapeshell
scrapeshell.exe.manifest
scrapeshell-script
(but nothing about scrapelib)

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

Scrapelib would not appear in env/Scripts, it is a Python module, not a
script.

Are you sure your virtualenv is activated? If you've installed it you
would be able to import it. Does "import requests" still work?

On Wed, Jun 25, 2014 at 6:22 PM, pollecuttn [email protected]
wrote:

Traceback (most recent call last):
File "C:\Users\natalie\Documents\Encore-in-Google\scrapelib-test.py", line
1, in
import scrapelib
ImportError: No module named 'scrapelib'

At least it's a different message...

So is it telling me I don't have scrapelib? I just tried uninstalling
and reinstalling scrapelib again, in my virtualenv, and I'm still getting
the same ImportError: No module named 'scrapelib'.

I can still see these in env/Scripts:
scrapeshell
scrapeshell.exe.manifest
scrapeshell-script
(but nothing about scrapelib)


Reply to this email directly or view it on GitHub
#19 (comment)
.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

I've been working from http://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/ That says pip is in will be in env/bin/pip. I don't have a /bin/ dir, but pip is in env/Scripts so I was using that instead (as a best guess).

I've just had a look in other directories and there is a scrapelib in C:\Users\natalie\Documents\Encore-in-Google\env\Lib\site-packages. Does that sound good? And if so, how do I import scrapelib from there?

I can't see a /bin/ dir anywhere in this project.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

import requests still works (still getting a 200 response from http://google.com/)

from scrapelib.

jamesturk avatar jamesturk commented on August 15, 2024

Sorry- I'm really not qualified to give advice on a Windows Python
environment though, not sure I'll be able to help with this as it doesn't
seem like a scrapelib issue.

I can say that scrapelib being in site-packages is a good thing, assuming
the env is activated, my guess right now is that it isn't activated (the
fact that there isn't an env/bin is concerning as that is where the python
binary should be), but I can't confirm.

On Wed, Jun 25, 2014 at 6:30 PM, pollecuttn [email protected]
wrote:

I've been working from
http://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
That says pip is in will be in env/bin/pip. I don't have a /bin/ dir, but
pip is in env/Scripts so I was using that instead (as a best guess).

I've just had a look in other directories and there is a scrapelib in
C:\Users\natalie\Documents\Encore-in-Google\env\Lib\site-packages. Does
that sound good? And if so, how do I import scrapelib from there?

I can't see a /bin/ dir anywhere in this project.


Reply to this email directly or view it on GitHub
#19 (comment)
.

from scrapelib.

pollecuttn avatar pollecuttn commented on August 15, 2024

Okay, that's fair enough. At least it looks like I've got scrapelib. Thanks a lot for all your help! I'll try to figure out the env/bin problem.

from scrapelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.