Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Install via Windows Powershell, sfctl is not recognized #244

Open
aaaronic opened this issue Nov 5, 2021 · 0 comments
Open

After Install via Windows Powershell, sfctl is not recognized #244

aaaronic opened this issue Nov 5, 2021 · 0 comments

Comments

@aaaronic
Copy link

aaaronic commented Nov 5, 2021

Background

I installed sfctl according to the documentation here: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cli

After install, sfctl is not recognized:

> sfctl
sfctl : The term 'sfctl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct  
and try again.

It clearly is a PATH issue of some sort and I see documentation about how to fix a similar issue on Linux / Mac, but I don't see similar information for Windows (in my case, 10). Here is the relevant information about my installation:

> pip show sfctl
Name: sfctl
Version: 11.1.0
Summary: Azure Service Fabric command line
Home-page: https://github.com/Azure/service-fabric-cli
Author: Microsoft Corporation
Author-email: [email protected]
License: MIT
Location: c:\users\aaronhansen\appdata\roaming\python\python39\site-packages
Requires: sfmergeutility, portalocker, knack, tqdm, msrest, six, applicationinsights, psutil, adal, msrestazure, requests, azure-servicefabric, joblib, future
Required-by:
> pip -V
pip 21.1.1 from c:\program files (x86)\microsoft visual studio\shared\python39_64\lib\site-packages\pip (python 3.9)
> python -V
Python 3.9.5

I could see the issue being related to my pip/Python having been installed by Visual Studio, instead of the typical Python installation, but I imaging a lot of Windows developers might be in the same situation.

I found the sfctl site-package in C:\Users\me\AppData\Roaming\Python\Python39\site-packages, but it seems the "global" site-packages folder is C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\Lib\site-packages (since that's where pip is).

The Solution:

The solution was to add the following to my PATH:
C:\Users\me\AppData\Roaming\Python\Python39\Scripts

If you see the following during installation on Windows, you might be in the same boat:

> pip install sfctl
Defaulting to user installation because normal site-packages is not writeable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant