Always get `ModuleNotFoundError: No module named 'encodings'` error.
See original GitHub issueI tried to use twitter-scraper. I ran the command described in the README:
pipenv install twitter-scraper
I got this error back:
❯ pipenv install twitter-scraper
Installing twitter-scraper…
⠇
Error: An error occurred while installing twitter-scraper!
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fff793b5000 (most recent call first):
I searched online for ModuleNotFoundError: No module named 'encodings'
and could not find anything I could use to solve this.
Describe your environment
- OS Type: macOS
- Python version: Python 3.7.0b1
- Pipenv version: version 10.0.0
Expected result
pipenv works and doesn’t throw that error.
Actual result
~/dev/testing/py-test
❯ pipenv install twitter-scraper --verbose
Installing twitter-scraper…
⠋Installing 'twitter-scraper'
$ "/Users/nikivi/.local/share/virtualenvs/py-test-7jzMe1F-/bin/pip" install --verbose "twitter-scraper" -i https://pypi.python.org/simple --exists-action w
⠧
Error: An error occurred while installing twitter-scraper!
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fff793b5000 (most recent call first):
Steps to replicate
I ran pipenv install twitter-scraper
. But it seems that in my case all instances of pipenv install
are broken. Not sure what to do.
Thank you for any help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
ImportError: No module named 'encodings' - python
It seems like that the python installation is incomplete. Have you installed python via apt or have you compiled and installed it from...
Read more >ModuleNotFoundError: No module named 'encodings' #516
I keep getting: ModuleNotFoundError: No module named 'encodings' in the unit error logs when trying to add new configuration.
Read more >No Module named “Encodings” — A common ... - faun.dev
When you download Python3. · Then, open system properties and navigate to the “Advanced” tab. · Ensure that the Python path for your...
Read more >No Module named “Encodings” — A ... - FAUN Publication
The Solution! · When you download Python3. · Then, open system properties and navigate to the “Advanced” tab. · Ensure that the Python...
Read more >modulenotfounderror no module named encodings - You.com
Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'. The first thing you should try is to ......
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 Free
Top 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
Okay, I realised my mistake. Apparently you cannot run
pipenv
in a directory that has other files. I ran the command in empty dir and everything worked.Hi @kennethreitz
I wanted to make sure I do actually have
pipenv
working as intended. Is this normal that if I have a .py file already in a directory,pipenv
fails with that message ofModuleNotFoundError: No module named 'encodings'
?