I installed pycurl for python3
but when I want to import it to Pycharm and use it I get this error message:
Traceback (most recent call last):
File "/home/cours/PycharmProjects/untitled2/venv/test.py", line 1, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/home/cours/PycharmProjects/untitled2/venv/test.py", line 1, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
But when I install it with the Pycharm terminal (pip install pycurl) I get this message
Requirement already satisfied: pycurl in /usr/lib/python3/dist-packages (7.43.0.1)
I also already imported the package with : Settings -> Python Interpreter
And finally i also used : "Inherit global site-package" option of the project and the problem is the same
I have no idea what else i can do
use command this command to install package -
pip3 install pycurl
and also check the Pycharm python version in for code compile
Related
I have tried upgrading Python version on a Miniconda installation by running conda update python. The version was being taken from 3.8 to 3.10. This seems to have broken the installation. No matter what command I run, I get the following:
➜ project conda activate
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 13, in <module>
import ruamel_yaml as yaml
ModuleNotFoundError: No module named 'ruamel_yaml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 16, in <module>
import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/bin/conda", line 15, in <module>
sys.exit(main())
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/cli/main.py", line 118, in main
from ..exceptions import conda_exception_handler
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/exceptions.py", line 24, in <module>
from .models.channel import Channel
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/models/channel.py", line 17, in <module>
from ..base.context import context, Context
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/base/context.py", line 55, in <module>
from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/configuration.py", line 42, in <module>
from .serialize import yaml_round_trip_load
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 18, in <module>
raise ImportError("No yaml library available. To proceed, conda install ruamel_yaml")
ImportError: No yaml library available. To proceed, conda install ruamel_yaml
Help on fixing this is appreciated.
I tried to install Django Framework in Ubuntu. and i am using python 3.8. but in normal instalation, Django 1.1 had been installed. and i changed the python3 alternative to python3.8 . and usuing python3 -m pip install django. and i installed Django(v 3.3) and used it. but after the changing the alternative, the Terminal doesn't open and start.
i deleted python3.6 from my ubuntu. and the problems had been started after that.
it seems some programs in linux run in python3.6 and after deleting that,
i can't fix the problems and the Terminal windows does not open. i tried other ways (changing the gnome-terminal file, changing the alternative to default v3.6 and fix the Broken distro), but they didn't help me. i can't open Terminal, and when i ran sudo apt update i recieved this Errors:
Any idea?
File has unexpected size (1133 != 1128). Mirror sync in progress? [IP: ***.**.***.** 80]
Release file created at: Wed, 06 May 2020 19:27:45 +0000 Fetched 1,762 B in 2s (932 B/s) Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 7, in <module>
import sqlite3 File "/usr/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import * File "/usr/lib/python3.6/sqlite3/dbapi2.py", line 23, in <module>
import datetime File "/usr/lib/python3.6/datetime.py", line 8, in <module>
import math as _math ModuleNotFoundError: No module named 'math' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in <module>
import subprocess, tempfile, os.path, re, pwd, grp, os, time, io File "/usr/lib/python3.6/subprocess.py", line 136, in <module>
import _posixsubprocess ModuleNotFoundError: No module named '_posixsubprocess'
Original exception was: Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 7, in <module>
import sqlite3 File "/usr/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import * File "/usr/lib/python3.6/sqlite3/dbapi2.py", line 23, in <module>
import datetime File "/usr/lib/python3.6/datetime.py", line 8, in <module>
import math as _math ModuleNotFoundError: No module named 'math' Reading package lists... Done E: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages.gz File has unexpected size (1133 != 1128). Mirror sync in progress? [IP:
* 80] Hashes of expected file:
- Filesize:1128 [weak]
- SHA256:*
- SHA1:*
- MD5Sum:*
Release file created at: Wed, 06 May 2020 19:27:45 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead. E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi' E: Sub-process returned an error code
and below result showed when i tried to run django-admin:
Traceback (most recent call last):
File "/usr/bin/django-admin", line 5, in <module>
from django.core.management import execute_from_command_line
File "/home/pytm/.local/lib/python3.6/site-packages/django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "/home/pytm/.local/lib/python3.6/site-packages/django/utils/version.py", line 1, in <module>
import datetime
File "/usr/lib/python3.6/datetime.py", line 8, in <module>
import math as _math
ModuleNotFoundError: No module named 'math'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in <module>
import subprocess, tempfile, os.path, re, pwd, grp, os, time, io
File "/usr/lib/python3.6/subprocess.py", line 136, in <module>
import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/django-admin", line 5, in <module>
from django.core.management import execute_from_command_line
File "/home/pytm/.local/lib/python3.6/site-packages/django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "/home/pytm/.local/lib/python3.6/site-packages/django/utils/version.py", line 1, in <module>
import datetime
File "/usr/lib/python3.6/datetime.py", line 8, in <module>
import math as _math
ModuleNotFoundError: No module named 'math'
profiling:/home/user/Downloads/Python-3.6.10/Programs/python.gcda:Cannot open
profiling:/home/user/Downloads/Python-3.6.10/Modules/xxsubtype.gcda:Cannot open
after a few hours, i found a way to fix the problems.
First, I made a backup of all my data(I would recommend to everyone trying this). Although it worked for me, it may fail for some reason on your machine and you don't want to lose your data.
I ran the following commands to remove the old version of python3.6 without removing all the dependencies and to directly install the default version.
sudo dpkg --remove --force-depends python3.6 python3.6-minimal libpython3.6-minimal libpython3.6-stdlib
sudo apt-get install python3.6 python3.6-minimal libpython3.6-minimal libpython3.6-stdlib
I ran sudo apt-get update and sudo apt-get upgrade before rebooting my machine.
everything became ok..
I just cannot use jupyter notebook. I have updated to the most recent version by ananota, and it still does not work.
The error message is listed below:
C:\Users\willian>jupyter notebook
Traceback (most recent call last):
File "C:\Anaconda3\Scripts\jupyter-notebook-script.py", line 3, in <module>
import notebook.notebookapp
File "C:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 40, in <module>
ioloop.install()
File "C:\Anaconda3\lib\site-packages\zmq\eventloop\ioloop.py", line 207, in install
from tornado import ioloop
File "C:\Anaconda3\lib\site-packages\tornado\ioloop.py", line 47, in <module>
from tornado.concurrent import TracebackFuture, is_future
File "C:\Anaconda3\lib\site-packages\tornado\concurrent.py", line 34, in <module>
from tornado.util import raise_exc_info, ArgReplacer, is_finalizing
ImportError: cannot import name 'is_finalizing'
From your error it looks like the tornado package is not installed in your environment. Installing tornado with the command below should fix your problem.
pip install tornado
I have installed python 3.6.0, you don't need to install pip manually if you are using python (>3.3). But When I am trying to access pip (pip --version), it throws me two errors which mainly relate to not finding the module.
Description is given below.
C:\Users\sharma6>pip --version
Traceback (most recent call last):
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
from . import urllib3
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 7, in <module>
from socket import error as SocketError, timeout as SocketTimeout
File "c:\python360\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python360\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python360\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python360\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python360\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ModuleNotFoundError: No module named 'urllib3'
Even when I import socket (>>>import socket)in python interpreter , It shows me "Can not found the module" error .
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\python352\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket
Could someone tell me about the errors and how to resolve them because I need pip to work properly.
Add your all path in your system variable instead of adding in user variable.
It worked for me!!! :)
You should try to write
python -m pip --version
If this gives an error message, install pip by downloading get-pip.py from https://pip.pypa.io/en/stable/installing/ and install with
python get-pip.py
Installing with pip is then done by
python -m pip install [package name]
I've installed xxhash module with:
sudo pip install --upgrade pip
sudo pip install xxhash
But when I execute:
pydoc modules
I get a list of available modules in which there's no xxhash.
And when I run in terminal a GUI program it gives me an error:
Python: Traceback (most recent call last):
File "./runserver.py", line 34, in <module>
from pogom.search import search_overseer_thread, fake_search_loop
File "/SOME_PATH/resources/app/map/pogom/search.py", line 30, in <module>
from pgoapi import PGoApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/__init__.py", line 39, in <module>
Python: from .pgoapi import PGoApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/pgoapi.py", line 34, in <module>
from .rpc_api import RpcApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/rpc_api.py", line 47, in <module>
from .utilities import to_camel_case, get_time, get_format_time_diff, Rand48, long_to_bytes, generateLocation1, generateLocation2, generateRequestHash, f2i
File "/SOME_PATH/resources/app/map/pogom/pgoapi/utilities.py", line 37, in <module>
import xxhash
ImportError: No module named xxhash
BTW, the 2 first commands worked with no error and when I rerun them it says that these modules are already installed and up to date.