Ubuntu Python kurulması gereken moduller eklentiler


socks Hatası 
<module>
    import socks
ImportError: No module named 'socks'

Kurulması gereken
python 2 için
sudo apt-get install python-socks

python 3 için
sudo apt-get install python3-socks
veya
pip install PySocks

Hata
The program 'pip' is currently not installed. You can install it by typing:
apt install python-pip

Kurulması gereken
apt-get install python-pip
veya
apt-get install python3-pip

Tekrar
pip install PySocks

Hata
Requirement already satisfied (use --upgrade to upgrade): PySocks in /usr/lib/py                     thon2.7/dist-packages
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Gereken Komut
pip install --upgrade pip

Hata
Traceback (most recent call last):
  File "a.py", line 10, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named 'bs4'

Kurulması gereken
sudo pip install BeautifulSoup4
veya
sudo apt-get install python3-bs4

Hata
Traceback (most recent call last):
  File "a.py", line 1, in <module>
    from scapy.all import * # importa scapy
ImportError: No module named 'scapy'

Kurulması gereken
sudo apt-get install python-scapy
veya
sudo apt-get install python3-scapy

Bunlara rağmen scapy kurulmuyorsa alternatif olarak şunu deneyin
Linux deposunu kontrol edin
sudo apt-get install git
Scapy'i standart yollarla manuel kurun:
git clone https://github.com/phaethon/scapy

cd scapy
sudo python3 setup.py install

git pull
sudo python3 setup.py install

Hata
The program 'gedit' is currently not installed. You can install it by typing:
apt install gedit

Kurulması gereken
sudo apt-get install gedit

Hata
Traceback (most recent call last):
  File "deneme.py", line 2, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4

Kurulması gereken
pip install beautifulsoup4

Hata
Traceback (most recent call last):
  File "deneme.py", line 3, in <module>
    import urllib.request
ImportError: No module named request
ImportError: No module named requests

Kurulması gereken
pip install requests

Bu komuttan sonra şuna benzer bir hata alırsanız
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

 

Yapmanız gereken
pip install --upgrade pip

python 2 için
Kodlarınızın en başında
şu ibare var ise
import urllib.request
Şununla değiştirin
from urllib2 import urlopen #python2 için çalışır
Nedeni ise
import urllib.request #python3 için çalışır

ve python3 kodlarınız şu şekildeyse
Örnek:
parseurl = "https://www.google.com"
html = urllib.request.urlopen(parseurl)
soup = BeautifulSoup(html, 'html.parser')
print(soup)


Şunlarla değiştirmelisiniz
html = urlopen("https://www.google.com")
print(html.read())





Yorumlar