0

I have kubernetes pod with image: debian:9.4. I do:

  apt -y install python3.6
  apt -y install python3-pip
  pip3 install pymssql

But when I run script

  import pymssql
  connection = pymssql.connect(server='', DATABASE='', user='', password='')

I get

Collecting pymssql
Downloading https://files.pythonhosted.org/packages/1e/68/ecb6fdOee024a9ed8a852e7993ba0d059039a9cbc03a515bc1c8b92f8014/pymssg1-2.2.1.tar.gz 170kB) 
Complete output from command python setup.py egg_info: 
Traceback (most recent call last): 
File "<string>", line 1, in <module> 
File "irtmp/pip-build-hhjppxzp/pymssql/setup.py", line 54 
raise Exception(f"Unsupported environment value {env_name}={val}") 

SyntaxError: invalid syntax 

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hhjppxzp/pymssql/ 
Traceback (most recent call last): 
File "db.py", line 1, in <module> 
import pymssql
ImportError: No module named 'pymssql' 

I have tried install pymssql directly (without pip)

apt -y install python3-pymysql

but end is the same

Traceback (most recent call last): 
File "db.py", line 1, in <module> 
import pymssql
ImportError: No module named 'pymssql' 

How to fix this problem?

Eduard Nickel
  • 135
  • 1
  • 2
  • 13
  • try, https://stackoverflow.com/questions/44490286/how-to-install-pymssql-module-in-python-3-6 – Jisson Jun 07 '21 at 13:51

1 Answers1

0

why don't you try a miniconda version to install a environment and keep it there, it will it help to disguise what exactly is in the conda env.

Tamil Selvan
  • 1,600
  • 1
  • 9
  • 25