ModuleNotFoundError: No module named 'zipfile' when using pip - python

I'm new to Python and I have installed multiple versions (Anaconda3 and Python 3.7.4) on my Mac.
My pip is not working. When I run any pip command, everything appears to be importing properly. But it gets the last line, import zipfile, and I get the message:
ModuleNotFoundError: No module named 'zipfile'
I have been Googling for hours and I can't seem to find a solution.
My Python now lives in the Anaconda directory /users/NAME/opt/anaconda3/.
Ultimately, I would like to start from scratch and just reinstall Python 3.7.4 again, so it's all nice and clean. I can't uninstall Anaconda because I get the same ModuleNotFoundError: No module named 'zipfile'.
I have also tried to install the module zipfile and that doesn't work either.
Can someone help?
Thanks
Thanks everyone for your help so far. I am really new to Python, so I don't think I explained myself properly.
UPDATE: I think I have fixed my problem. Pip was looking for the file zipfile, so I downloaded https://pypi.org/project/zipfile36/#files and changed the name of zipfile36.py to zipfile.py.
Seems like it did the trick.

Related

ModuleNotFoundError: No module named 'django-quill' Python3

I am trying to run someone else's code without a requirements.txt file and it says: ModuleNotFoundError: No module named 'django-quill. I tried to do pip install django-quill in a virtual env but I still get the same error. What am I missing here?
As it turns out, I had to run pip install django-quill-editor in order for the code to work as expected. I am still not sure why the original command did not work but this resolved the issue for me.
You can find the official setup guide for Django quill here: https://github.com/LeeHanYeong/django-quill-editor#setup

Why Python does not recognize "kivy" module for me?

After I install the "kivy" python module, the python console and IDEs don't recognize it as a module, as if it doesn't exist.
ModuleNotFoundError: No module named 'kivy'
I do the installation normally like any other. I reinstalled the module several times and looked for all possible solutions, but nothing. Also, pip list and pip3 list tells me the module is there. What should I do?
When I completely reinstalled the system the problem was solved.

Module importing works in python console (pycharm) but not works on terminal

Hi i'm recently working on a module in python (package named pykiwoom)
I installed a module in conda 32-bit environment pip install pykiwoom and tried to import this
from pykiwoom.kiwoom import Kiwoom
This works perfectly fine when I execute this in python console in pycharm
However, when I try this in terminal error occurs
ModuleNotFoundError: No module named 'pykiwoom.kiwoom'; 'pykiwoom' is not a package
internal structure of package pykiwoom looks like this
pykiwoom
init.py
kiwoom.py
parser.py
Can somebody tell me why this error occurs?
I think where you install your package is important in your case. You can check the packages installed using pip list in terminal, and check if you find it there.
This solution provides overview of how to setup your files as packages and modules.
Nevertheless, I think if you install your package in the terminal using pip, you could possibly access it.

ModuleNotFoundError: No module named 'tabula'. After trying many things

Yes, I know this question has been asked in the past, twice. Still I tried all the ideas that were proposed plus ideas from other websites and yet it still doesn't work, so here I go:
I have windows 10, python 3.8.3 and java 1.8.0_261.
I tried first pip install tabula-py.
Then I tried pip install tabula_py.
Then I tried to find the version of java in cmd which it didn't find. I then added a path (I found on the internet) to the settings in "My PC" and then I did find the version of java.
I tried to restart my computer.
I tried pip uninstall tabula-py and then pip3 install tabula-py
But still, when I run "import tabula" in jupyter notebook, it says he can't find this module. I have searched the entire internet and tried everything suggested but with no luck. Can anyone please help me?
Links to the other 2 questions I went over:
Python: I tried to use tabula: ModuleNotFoundError: No module named 'tabula'
Tabula-py - ImportError: No module named tabula
So in the end I found yet another link with a line of code that did work!
conda install -c conda-forge tabula-py
To my dissapointment I have no idea why this works and why the other suggested code didn't, as cmd is not my specialty. If anyone understands and could explain what the issue was or what the difference is, I would love to hear. Thank you
Source: https://anaconda.org/conda-forge/tabula-py
I only ran the first line
Does the "conda" only work in a specific environment ?
Because I try command in vs_code but show errors about "conda" is unrecognized command...

Downloaded package ImportError

I have recently installed python 2.17.14 to use a package which I installed in the command prompt with:
python -m pip install packageName
However, whenever I try to use it with a script provided by the package authors, I get Import Errors:
ImportError: cannot import X from YX
ImportError: attempted relative import with no known parent package.
I don't know what I'm doing wrong, as I am really new to Python. Does anyone have any ideas?
The package is called neurodesign and I downloaded the try out script from the official website "neuropowertools.org"
Best,
Max
In case anyone (who is also new to python^^) fails ridiculously at this task as well: I had to manually install all the modules used within this package for it to work as they weren't installed automatically.

Categories