ModuleNotFoundError: No module named 'pysftp' - python

I am getting following error while trying to use 'pysftp' module in Jupyter Notebook:
End Goal: Download files from Unix server onto Windows folder automatically through a web-based application written in Python.
In this process, when I try to connect to WINSCP in order to allow python code to login to Unix server(username#hostname), I used 'pystftp' module however I get below error message:
Error Message: ModuleNotFoundError: No module named 'pysftp'
Action taken:
pip list - to view the already installed packages in python; I doesn't show pysftp
pip install pysftp - to install pysftp module; get below error when ran this in jupyter notebook
error message:
Collecting pysftp
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227A34A2400>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/pysftp/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227A33BC4A8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/pysftp/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227A33BCE80>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/pysftp/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227A33BCEB8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/pysftp/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227A33BCE48>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/pysftp/
Could not find a version that satisfies the requirement pysftp (from versions: )
No matching distribution found for pysftp
Request:
Please direct and help me achieve my end goal.
I am writing a code in Jupyter Notebook
Thanks,
Puneet

At first suggestion: You should check the location for PYTHON installation path and from that directory go to cmd -> and type: pip installs pysftp. If the installation is successful then the problem is in your interpreter selection where your scripts are running.

Related

Failed to establish a new connection in wsl when i use pip install

I want to install flask-sqlalchemy within the virtual environment on my ubuntu subsystem (WSL) on Windows 11, using the following command:
pip install flask-sqlalchemy
however i recieve an error in console window.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c27dff10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620520>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c26206d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620880>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
ERROR: Could not find a version that satisfies the requirement flask-sqlalchemy (from versions: none)
ERROR: No matching distribution found for flask-sqlalchemy
I think it is related with network connection in my Ubuntu subsystem. I try on Standalone Linux system and it seems to be work. How i can solve this issue?
i finnaly resolve my issue. I post below steps to solve this problem.
I checked my fireewall settings. It was not an issue.
i dont use proxy so i skipped the proxy issue.
i checked ping from the console window
ping google.com
it displayed
ping: google.com: Temporary failure in name resolution
I found a solution. Seems like my DNS server can't find an address associated to the URL i am passing. I got errors because the resolv.conf file was not set up in my Ubuntu Subsystem.
solution:
in wsl Ubuntu Linux type commamnd
sudo nano /etc/resolv.conf
add nameserver and save file
nameserver 8.8.8.8

Error to install packages in python Computer without a network ( Errno 11001)

strong textI manually install package as follows:
pip install C:\Users\AAA PC\Desktop\selenium.whl
I get the following error:
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0424C6F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E150>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E230>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E3F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
First upgrade:
python -m pip install --upgrade pip
Then, enter in the terminal:
pip install -U selenium
pip install "C:\Users\AAA PC\Desktop\selenium.whl"
This should install from any directory.
An important thing worthy of noting is the .whl file name should not be renamed from the original. For example, if you want to install .whl for the selenium module, I believe the original name of the file is "selenium-3.141.0-py2.py3-none-any.whl" (as per PyPI)
Hence you need to rename the file to the original name and install using
pip install "C:\Users\AAA PC\Desktop\selenium-3.141.0-py2.py3-none-any.whl"
else you could see errors like "ERROR: selenium.whl is not a valid wheel filename"
Also, your error says, collecting requests.
This tells the python is having issues downloading the requests module, not with the selenium module. Hence you could first install requests.whl and then try installing selenium
First make sure pip is up to date using this command:
python -m pip install --upgrade pip
Then run to install the wheel file, run this command:
pip install "C:/Users/AAA PC/Desktop/selenium.whl"
However, this is not the original name of the wheel file. The official wheel name, from PyPi is:
selenium-3.141.0-py2.py3-none-any.whl
So you should delete that file and reinstall it from PyPi. You'll end up with this command:
pip install "C:/Users/AAA PC/Desktop/selenium-3.141.0-py2.py3-none-any.whl"
How about instead of using Pip, use setup.py. If you download the selenium tarball you can run python setup.py install from within the uncompressed directory of the tar file.

Cant install pip PyMySQL using Anaconda prompt

I tried to download the pip install PyMySQL on my Anaconda prompt (Im using Spyder as IDE). Its not working. I received this error. Someone who knows how to fix it? Iam using Python version 3.7.4 64-bit. Thank you in advance :)
(base) C:\Users\AK>pip install PyMySQL
Collecting PyMySQL
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC2F84C8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC30CC48>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319408>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319908>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319B88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
ERROR: Could not find a version that satisfies the requirement PyMySQL (from versions: none)
ERROR: No matching distribution found for PyMySQL
This could be due to an antivirus or some other program on your computer interfering with network connections (see pip install is not working).
I am able to install PyMySQL with the following:
pip install PyMySQL
There are a few possible solutions.
Install with conda: conda install pymysql
Download the wheel for PyMySQL and install it using that file.
Go to https://pypi.org/project/PyMySQL/#files and download the .whl file.
Run pip install path/to/PyMySQL-0.9.3-py2.py3-none-any.whl
If antivirus is in fact playing a role, then I'm not sure what to do, but google is your friend.

Install packages (pywin32, win10toast and many others) via pip install not possible

I have installed python 3.8, and need to install pywin (pywin32)
However, pip cannot find it. Note, i have tried to install some other packages with pip install command in terminal before, but those don't work either.
A few possibly relevant data points:
new install of python 3.8.1
windows 10 x64
python 3.7 was previously installed on the machine
I'm using pycharm 2019.3.3. There in venv/Lib/site-packages it shows that setuptools and pip is installed.
I use the terminal in pycharm, since however it's the only console which let's me go to the path system C: ---> the normal cmd of windows is always on M:, even if I change directory, it always goes back to M: (I don't know why)....
What I tried:
*cmd -> netsh winhttp show proxy #As I thought the installation problems might relate to the proxy. But it doesn't because at work we don't use one, it's DirectAccess (no proxy).
*to install pywin32; Errorcode:
Collecting pywin32
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002189212F3A0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pywin32/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002189212FE20>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pywin32/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x0000021892150880>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pywin32/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x0000021892150AC0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pywin32/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x00000218921507C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pywin32/
Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32
*to install pypiwin32; Errorcode:
Collecting pypiwin32
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002670BE9FFA0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002670BE9FCD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002670BEC08B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002670BEC0AF0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x000002670BEC07F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/
Could not find a version that satisfies the requirement pypiwin32 (from versions: )
No matching distribution found for pypiwin32
Can you help me please?
Also, if there is already one topic which is helpful, I would be happy about it. I wasted hours of searching this website, but there's too much...
How did I get to this issue:
I want to write a code with popup notification for the Windows taskbar. Therefore want to use win10toast but pip cannot install - I checked the requirements and it's necessary to install pywin32 and setuptools first. So setuptools was pre-installed, therefore ok.
But pywin32 installation is not possible.
If you could offer me a better solution than win10toast this would also be helpful ;-)
A million thanks! Wish you a happy day :)
You could use plyer instead of win10toast just install it And write
From plyer import notification
a= Notification.notify(title= ,message=,icon=,time=)

Unable to download Django 2.0.7 in windows 10

DISCLAIMER - I am new to the world of Django and Python. If the question sounds stupid, please bear with me.
OS - Windows 10
Python Version Installed - 3.7
In the windows command prompt, I am trying the following command to download django on my system.
pip install django
pip3 install django
Collecting django
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/
Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django
If anybody could help me out or show some direction that would be great. Thanks in advance.
DISCLAIMER 2 :- This is an office environment and not my personal system so there should be restrictions on the firewall and other such good stuffs.
You can try downloading Django unofficial binaries form https://www.lfd.uci.edu/~gohlke/pythonlibs/ (use ctrl + F to find the package)
and install using
pip install "path to downloaded wheel file"
Edit: Offline installation of Django worked with the OP as he did not like to install the unofficial binaries.
Downloaded pytz from https://pypi.org/project/pytz/#files
And then downloaded Django from https://pypi.org/project/Django/#files
Installed wheel files of pytz first and Django next using pip.
This is because your internet proxy is blocking it. So download the installable(.whl,tz) from the server and copy to your local and install it with
pip install <downloaded file name>

Categories

Resources