devopshq / tfs

Microsoft TFS API Python client
https://devopshq.github.io/tfs/
MIT License
110 stars 28 forks source link

name 'tfs' is not defined #81

Closed danherb closed 4 years ago

danherb commented 4 years ago

Hi, I installed python 3.8 through chocolatey on win10. Then in cmder I ran simple script but it fails at the 1st line:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'tfs' is not defined

First line is: from tfs import TFSAPI

Do anyone has any idea what to do, please? Thanks!

SAnCherepan commented 4 years ago

@Danecek1, make sure you have the dohq-tfs package installed for the python that is used to run the script.

If you only have one python version installed then run pip install dohq-tfs in you cmd. If you have multiple python versions on the same machine, use <your_python_executor> -mpip instal dohq-tfs instead.

Let me know if it helps.

danherb commented 4 years ago

@SAnCherepan Thanks a lot, I have 2 versions - 2.7 and 3.8. I did python -mpip instal dohq-tfs for python 2.7, but I need for 3.8 so I ran: python3 -mpip install dohq-tfs but this command does completely nothing. Even if I try run easy script with python3 (which just prints "hello"), it doesnt nothing.

Thanks a lot.

danherb commented 4 years ago

@SAnCherepan I resolved it. Dont know why, but I had to install python through Windows Store directly and it works. Before, I installed it through chocolatey...

Thanks again, Daniel

SAnCherepan commented 4 years ago

@Danecek1 always welcome!