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

cannot import name AdvancedHTMLParser #8

Closed
drattar opened this issue Jun 27, 2019 · 4 comments
Closed

cannot import name AdvancedHTMLParser #8

drattar opened this issue Jun 27, 2019 · 4 comments

Comments

@drattar
Copy link

drattar commented Jun 27, 2019

there is error in importing AdvancedHTMLParser in python 3.7.
i used:
import AdvancedHTMLParser
but i got:

Traceback (most recent call last):
  File "J:\Ext_links.py", line 6, in <module>
    import AdvancedHTMLParser
ImportError: cannot import name AdvancedHTMLParser

and the AdvancedHTMLParser is installed!!

C:\Program Files\Python 3.7\Scripts>pip install AdvancedHTMLParser
Requirement already satisfied: AdvancedHTMLParser in c:\program files\python 3.7\lib\site-packages (8.1.6)
Requirement already satisfied: QueryableList in c:\program files\python 3.7\lib\site-packages (from AdvancedHTMLParser) (3.1.0)
@drattar
Copy link
Author

drattar commented Jun 27, 2019

some thing bizarre ..
it work in visual code studio ..
but it was not in python IDLE

@kata198
Copy link
Owner

kata198 commented Jul 20, 2019

You need to ensure that it is within your PYTHONPATH environment variable. This is also viewable in IDLE via:

import sys
print ( repr(sys.path) )

Not real sure what the issue is, perhaps there is a permissions issue on the folder? Or you may be launching IDLE under a version other than python 3.7, etc. But the problem is on your end, somewhere.

I can help you resolve this, but will need further information.

@kata198
Copy link
Owner

kata198 commented Jul 20, 2019

As in, "c:\program files\python 3.7\lib\site-packages" should appear within that list when you print sys.path. If it does -- there is some permissions issue you can probably resolve by right clicking on the folder -> properties -> and adding the rights. This can happen in multi-user environments on windows.

If it does not, then you are not launching IDLE under python 3.7, which I suspect is the issue here.

@kata198
Copy link
Owner

kata198 commented Sep 11, 2019

Closing due to inactivity

@kata198 kata198 closed this as completed Sep 11, 2019
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