Getting syntax error when I run the following pip install paramiko - python

I have python 2.7.13 for windows 7. I recently installed python 3.8 in a separate folder (c:\Python38).
I tried to install contextlib or paramiko modules, but i get the following error.
C:\Python38>pip install paramiko File "C:\Python38\Lib\site.py",
line 178 file=sys.stderr)
^
SyntaxError: invalid syntax
PYTHONPATH=C:\Python38;C:\Python38\Lib;C:\Python38\DLLs;C:\Python38\Lib\lib-tk
What am I missing? Thanks for your help.

Related

glob2 install using IDLE on Mac

So, my exercise says to use glob2 but I tried like six ways and never could get the module installed. I am using IDLE for my terminal. When I open the folder that has all the modules in it, I see pip and glob.
I am using python 3.8, IDLE on a Mac using High Sierra
I tried:
import pip #got no error
pip install glob2
SyntaxError: invalid syntax
Also tried this:
pip.install('glob2')
Traceback (most recent call last):
File "", line 1, in
pip.install('glob2')
NameError: name 'pip' is not defined
I then looked up the path and tried using that:
import sys; sys.executable
'/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8'
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m pip install glob2
SyntaxError: invalid syntax
at this point I am at a loss. The last suggestion was posted here: https://www.honchosearch.com/blog/seo/install-python-modulespackage-using-idle-mac/

ModuleNotFoundError after installing tableauserverclient

I am writing my first python script to establish a connection with tableau.
Getting the below error:
ModuleNotFoundError: No module named 'tableauserverclient'
I have installed tableauserverclient using the command:
pip install tableauserverclient
Pip version: 19.3.1
tableauserverclient version: 0.9
Have you tried relative vs abosulte imports?
See this post for more information, there are a lot of fixes for your problem. relative Imports
And please give an example code from you code that creates that error

ImportError: cannot import name '_remove_dead_weakref' in ubuntu 16.04

I get the following error in Ubuntu 16.04 when I try to use commands like pip, pip3, pipenv, virtualenv:
ImportError: cannot import name '_remove_dead_weakref
I have both Python 2.7, Python 3.5, and Python 3.7 installed. When I type python in the command prompt I get this:
root#genopathngs-Precision-Tower-3620:/usr/local/bin# python File
"/usr/local/lib/python3.5/site.py", line 176
file=sys.stderr)
^ SyntaxError: invalid syntax
Please help me resolve this.

How to solve the Error related to Python Libraries on no module?

I am using Python lib deepdiff.
I Installed using cmd -> python -m pip install --trusted-host https://pypi.python.org deepdiff as I got an error with SSL I used above to cmd. When I worked in pycharm using python version35 and executed my file.
C:\Python35\python.exe C:/Users/mytry.py
{'values_changed': {"r"}}
It works in Pycharm Tools
But when I try to run the file mytry.py in cmd prompt I get =>
from deepdiff import DeepDiff
ImportError: No module named deepdiff
I m using 3.5.4 in local as well
I don't know how to solve this please help!!
It worked after using the version in the command prompt.
C:\Python35\python.exe myfile.py
Output: BOTH JSON Match
Thanks all for your help.

tftpy package sytax errors on import

I've just installed the package tftpy version 0.6.2 when I import it I get a syntax error with the line:
running the code:
import tftpy
I get the error:
raise ImportError, "Requires at least Python 2.3"
SyntaxError: Invalid syntax
I have version 3.6.3 installed.
import sys
print(sys.version_info)
gives me the out put major=3, minor=6, micro=3.
However the line of code that raises the syntax error is the last line in the code below:
import sys
required_version = (2, 3)
if sys.version_info < required_version:
raise ImportError, "Requires at least Python 2.3"
I don't think the issue is with my version number I think it doesn't like the syntax used to raise the ImportError exception.
Any help would be greatly received.
I found the error in my case.
When you run a tftpy server, you need to run it as sudo, therefor you need to install tftpy as sudo also.
In my case:
$ sudo pip3 install tftpy
$ sudo python3 tftpy-program.py
Also remember that if you use python3, f.eks, you need to install the package with pip3, and not jsut pip. Hope it helps.

Categories