kjam / wswp

Code for the second edition Web Scraping with Python book by Packt Publications
129 stars 98 forks source link

from chp1.throttle import Throttle : Anaconda Error #8

Open Mavericks334 opened 6 years ago

Mavericks334 commented 6 years ago

Hi,

I am trying to use from chp1.throtte import Throttle In Anaconda 5 for Python 3.6 I get the error no module named chp1

i try !pip install chp1 it does not work either no matching distributions found for chp1

Could you let me know what is wrong.

Regards, Ren.

kjam commented 6 years ago

Hello @Mavericks334 ,

You will need to make sure the current directory is in your path. See if you can add it simply with 'import sys.pathand then using asys.path.append`. You will also need to be in the root directory when running the script. Let me know how it goes!

-katharine

benyamin-persia commented 5 years ago

Hi,

I am trying to use from chp1.throtte import Throttle In Anaconda 5 for Python 3.6 I get the error no module named chp1

i try !pip install chp1 it does not work either no matching distributions found for chp1

Could you let me know what is wrong.

Regards, Ren.

replace : from chp1.throtte import Throttle by this one : from throtte import Throttle

kjam commented 5 years ago

You should run this from a directory where the chp1 folder is available (from the repository itself). There is no way to pip install that. Or simply rewrite the import and move the files you need to import to a location that works for you.

To learn about how Python imports work, I recommend reading here: https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html

On Fri, May 31, 2019 at 11:43 PM benyamin-persia notifications@github.com wrote:

Hi,

I am trying to use from chp1.throtte import Throttle In Anaconda 5 for Python 3.6 I get the error no module named chp1

i try !pip install chp1 it does not work either no matching distributions found for chp1

Could you let me know what is wrong.

Regards, Ren.

replace : from chp1.throtte import Throttle by this one : from throtte import Throttle

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kjam/wswp/issues/8?email_source=notifications&email_token=AACRNWGYJUJJ25USHWLYY7DPYGLZZA5CNFSM4EW6WIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWOGUI#issuecomment-497869649, or mute the thread https://github.com/notifications/unsubscribe-auth/AACRNWAMHQ6EOTSKBXER4D3PYGLZZANCNFSM4EW6WITQ .