How can i resolve a pip install error on windows 10? - python

I'm running Windows 10 with Python 3.7 and Microsoft Visual Studio Code. I want to install some packages I've downloaded (pysimplegui and psycopg2) but every time I try to install I get an error like this in cmd. Even when I type the pip list command
Traceback (most recent call last):
File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
The files are in my programming folder and I've copied them also on the scripts folder but it's not working. Can you please help me ? thanks in advannce

Try using this code
python3 -m pip install library_you_want

Related

Python modulenotfound in cmd

I'm new to python and when I tried to update pip in cmd this appeared:
Traceback (most recent call last):
File "d:\pytong\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\pytong\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\pytong\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named
Now it pops up anytime I'm trying to do anything.
I think your best option is to reinstall python or follow this - How to completely remove Python from a Windows machine?
After that restart your PC and install python from python webiste.

i try to run a python file using streamlit, it gives me an error saying saying streamlit is not a pacakge, i did installl streamlit

it my first time using streamlit, i have installed sreamlit using pip install streamlit which it installed. itry running a python file using streamlit run pop.py it gives me this error below :
C:\Users\DELL>streamlit run pop.py
Traceback (most recent call last):
File "c:\users\dell\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\dell\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\Scripts\streamlit.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'streamlit.cli'; 'streamlit' is not a package
i don't know what to do. please help
You are using it in Python. After opening the cmd, do not write python. Just go to the folder and write streamlit run pop.py in cmd. Not in Python.

An error ocurred while starting the kernel Python in Spyder

I updated Python to version 4.2 with Anaconda Navigator. I am kind of new to programming, but I have an error in the console. It says "An error ocurred while starting the kernel" and than the following:
Traceback (most recent call last):
File "C:\Users\anass\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\anass\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\anass\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py", line 23, in
start.main()
File "C:\Users\anass\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 253, in main
import_spydercustomize()
File "C:\Users\anass\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 43, in import_spydercustomize
import spydercustomize
File "C:\Users\anass\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 31, in
from spyder_kernels.customize.spyderpdb import SpyderPdb
File "C:\Users\anass\Anaconda3\lib\site‑packages\spyder_kernels\customize\spyderpdb.py", line 23, in
from IPython.core.inputtransformer2 import TransformerManager
ModuleNotFoundError: No module named 'IPython.core.inputtransformer2'
What should I do to fix this?
When I open Spyder, it says (Python 3.6). Is that maybe part of the problem? Thanks in advance!
(Spyder maintainer here) Please open the Anaconda Prompt and run there
conda update anaconda
conda install ipython=7.6.0
That should fix your problem.

Why does my pip install requests giving me an error when i install it?

I tried installing requests with "pip install requests" but it shows this
Traceback (most recent call last):
File "c:\users\me\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\me\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\me\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
I am on windows 10
That may happens because you don't have proper set PATH of pip in your current machine, instead of use pip install ... you need to specify the python (may vary depending of your python version python3 or python) path and add the -m flag to specify the module that you want to use. in this case pip
try
python -m pip install requests

An error occurred while starting the kernel

I keep seeing this message.
An error ocurred while starting the kernel
Traceback (most recent call last):
File "C:\Users\Excel\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Excel\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Excel\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py", line 11, in
start.main()
File "C:\Users\Excel\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 279, in main
import_spydercustomize()
File "C:\Users\Excel\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize
import spydercustomize
File "C:\Users\Excel\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 5, in
from utilities import visualize_classifier
ModuleNotFoundError: No module named 'utilities'
I tried the following . . .
Try typing these 3 lines from the anaconda command prompt:
conda create -n spyder python=3.7 spyder
activate spyder
spyder
Also . . .
pip install --upgrade spyder
Unfortunately, nothing has worked thus far. Is there some kind of master reset to force this to startup correctly? Thanks a lot.
Try uninstalling spyder and spyder-kernels and run this to reinstall.
conda install spyder-kernels

Categories