TFTPy import, no module named tftpy - python

I installed TFTPy with both pip and pip3.
Then i followed the example on the TFTPy documentation, which follows:
import tftpy
server = tftpy.TftpServer('/tftpboot')
server.listen('0.0.0.0', 69)
But I get the error
ImportError: No module named tftpy
I also tried using from tftpy import tftpy. I tried using Python 2, Python 2.7 and Python 3, but still get the same error.
All help is appreciated

You can install tftpy by using command pip install tftpy. In case you do not have pip on your device, use the following commands:
yum -y install python-pip
pip install --upgrade pip
pip install tftpy

Related

How to resolve "ModuleNotFoundError: No module named 'package'" in notebook?

I installed a package in my notebook by running in a cell the following command:
!pip install packagename
but when I try to import the package, I'm getting the following error:
import packagename as pn
--> ModuleNotFoundError: No module named 'packagename'
I don't change my kernel between these commands, and also it seems installed correctly since running the install command again detects the installed package. I also tried re-installing it without success. What am I missing here?
To install any package on windows
pip install packagename
MacOS
python3 -m pip install packagename
Linux
sudo apt-get install packagename

Python pip module issues on Kali Linux

I am on my Kali Linux. When I run sudo python3 Storm-Breaker.py, I get an error
ModuleNotFoundError: No module named 'pyngrok'
But when I import pyngrok in an ordinary python file and then run it, it works out fine.
Please please help.
You shall install the package before using it.
Run the following command to install the package and its dependencies.
pip install pyngrok
You can try using the following command
sudo pip3 install -r requirements.txt

Python - Notion API - Can't import module

I'm trying to use Notion API for some automation processes but I am having some trouble importing the packages and I already try a lot of imports. I've this code:
from notion_database.database import Database
my_token = "my_token"
D = Database(integrations_token=my_token )
print(D.list_databases(page_size=100))
To run this code I made the following imports:
pip install notion-database
pip install notion-py
pip install "notion==0.0.25"
pip install notion
All of them were installed correctly and I don't have my script name as "notion.py" :D
But when I run my code I got:
from notion_database.database import Database
ModuleNotFoundError: No module named 'notion_database'
Does anyone know what I am doing wrong?
Thanks for the help!
It looks your code is fine.
More likely, your python and pip points onto two different python versions.
I would suggest you create an environment (virtualenv or pyenv) and reinstall the packages using this command:
sudo python -m pip install notion-database
sudo python -m pip install notion-py
sudo python -m pip install "notion==0.0.25"
sudo python -m pip install notion
maybe you have not install notion successfully.
try to replace pip install notion
to pip install notion --user
,after that maybe there is no error with run "import notion".
good luck!

Why is a package I have installed not getting recognised

I have installed a package named hypixel for my discord bot using pip install hypixel. It finished installing without any errors. At the top of my script I have import hypixel. But when I try and run it I get this error:
File "D:\Documents\Discord Bot\Addicts Discord Bot\bot.py", line 1, in <module>
import hypixel
ModuleNotFoundError: No module named 'hypixel'
I am not sure if this is too relevant but my pip isn't the latest version and I get an error when I try and update it.
Edit: I have now successfully updated my pip. But even when I try and reinstall the package it still won't work.
Instead of using pip install python, use pip install hypixel. Then try to import it in your code using import hypixel.
In your question you say you used pip install python, did you mean to say pip install hypixel?
Also if you use python3 but have python3 installed make sure you use pip3.
You can install this with sudo apt-get install python3-pip (assuming you use a debian based distro). Then use sudo pip3 install hypixel
Edit:
For windows installation follow this link

I am getting ImportError no module named pytube from python3

I have installed pytube by following command
sudo pip install pytube
It's ok when I import pytube from python 2.x.
But I am getting ImportError while importing from python3
Try to install the package with pip3 (sudo pip3 install pytube), in some operating systems pip refers to python2 and pip3 refers to python3.
Try to install pytube3:
sudo pip3 install pytube3
And after that you should be able to import pytube

Categories

Resources