Error Importing Module
See original GitHub issueI’m using PyCharm 2021.1.1 (Community Edition)
with Python 3.9
on Windows 10 Version 20H2
When I try to import this module I get the following:
Traceback (most recent call last):
File "C:\\Users\....\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 1039, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\s'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\....\PycharmProjects\ProjectFolder\script_name.py", line 8, in <module>
import pythonwhois
File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\__init__.py", line 1, in <module>
from . import net, parse
File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 359, in <module>
registrant_regexes = [preprocess_regex(regex) for regex in registrant_regexes]
File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 359, in <listcomp>
registrant_regexes = [preprocess_regex(regex) for regex in registrant_regexes]
File "C:\Users\....\PycharmProjects\ProjectFolder\venv\lib\site-packages\pythonwhois\parse.py", line 205, in preprocess_regex
regex = re.sub(r"\\s\*\(\?P<([^>]+)>\.\+\)", r"\s*(?P<\1>\S.*)", regex)
File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 327, in _subx
template = _compile_repl(template, pattern)
File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\re.py", line 318, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "C:\Users\....\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 1042, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Python import module error - Stack Overflow
I have a problem in import of modules in my project. I was creating tests and I cant import my main to test...
Read more >Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >ModuleNotFoundError: no module named Python Error [Fixed]
For resolving an imported module, Python checks places like the inbuilt library, installed modules, and modules in the current project. If it's ...
Read more >Resolve "Unable to import module" errors from Python ...
I receive an "Unable to import module" error when I try to run my AWS Lambda code in Python. How do I resolve...
Read more >How do I resolve the "Unable to import module" error I receive ...
... Knowledge Center article with this video: https://aws.amazon.com/premiumsupport/knowledge-center/lambda- import - module - error -python/0...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lebonMIA check out this PR "Fix to get regex to work on python > 3.6". If you are running python 3 you might need to edit the preprocess_regex fun in parse.py, it worked for me
Wow! Thanks! Now it’s working!