BookmarkSubscribeRSS Feed
jojozheng
Quartz | Level 8

Hi everyone,

I try to install SWAT. 

I input  pip install https://github.com/sassoftware/python-swat/releases/download/v1.5.0/python-swat-1.5.0-win64.tar.gz 

in Anaconada Prompt.

It shows syntax error. idk how to fix this..

2018-11-29 13_49_46-Anaconda Prompt - python.png

Thanks.

6 REPLIES 6
SimonDawson
SAS Employee
The Python package manager is a not run from with the Python REPL. It’s command line application you’d run from the command prompt of your operating system shell.

You might need to check the pip documentation for how to install it on your operating system if it not installed yet.
Andy547
SAS Employee

Anaconda is a virtual environment.  If you install swat there it will not stay like you want.  You can do it:

  1. Run conda create -n venv_name and source activate venv_name, where venv_name is the name of your virtual environment.

  2. Run conda install pip. This will install pip to your venv directory.

  3. At this point you have two versions of pip  installed; a global version and a version specific to your virtual environment. If you try to run pip install 'package_name' you’ll use the global version, which will install the package outside your virtual environment.
  4. Find your anaconda directory, and find the actual venv folder. It should be somewhere like /anaconda/envs/venv_name/.

  5. Install new packages by doing /anaconda/envs/venv_name/bin/pip install package_name.

  6. so: 
    1. conda create -n my_swat
    2. source activate my_swat
    3. conda install pip
    4. /anaconda/envs/my_swat/bin/pip install https://github.com/sassoftware/python-swat/releases/download/v1.5.0/python-swat-1.5.0-win64.tar.gz

This should now successfully install packages using that virtual environment's pip.  But if you want this for all of python, go to the OS prompt and use pip from there. 

jojozheng
Quartz | Level 8

Hi, 

 

After several trail, I got this error like below... How can I solve this issue? Thanks! 

 

2018-12-10 09_14_45-Anaconda Prompt.png

Andy547
SAS Employee

So sorry I missed your post.  

 

As I am sure you already know you can fix this by adding  the following in your pip.ini:

trusted-host = pypi.python.org pypi.org files.pythonhosted.org

 

or by using 

 

pip install --trusted-host pypi.org PyHamCrest 

 

Andy

jojozheng
Quartz | Level 8
Hi Andy, where can I find my virtual environment name? Thank you for your help!
Andy547
SAS Employee

You can list all of your conda environments with:

 

conda env list

Note the * shows the current active environment.  

 

Andy

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 2090 views
  • 4 likes
  • 3 in conversation