0

hi I have Anaconda installed at work. I tried to pip install sas7bdat, it does not work seems because I don't have internet access or any access to whatever could be downloaded....

Is there a way to pip install sas7bdat if I dont have internet access or external source. Is the file I need to install already inside my computer given I have Anaconda installed? Please kindly assist.

I dont have access due to security reason.

DSv1.0
  • 11
  • 1
  • You could install it if you had the .whl file, there is no other way to get the module without internet access. You can download it from an external computer and copy it to your work computer afterwards and do `pip install path/to/file.whl`. – Nick Aug 31 '22 at 10:07
  • U have three .whl file, they are as follows in anaconda\pkgs folder.. – DSv1.0 Sep 01 '22 at 03:54
  • example-21.12-py3-none-any.whl – DSv1.0 Sep 01 '22 at 03:54
  • pip-20.1.1-py2.py3-none-any.whl – DSv1.0 Sep 01 '22 at 03:55
  • setuptools-47.1.0-py3-none-aby.whl – DSv1.0 Sep 01 '22 at 03:55
  • which one do you mean or is there one for sas7bdat in particulat? I need sas7bdat for converting sas dataset to text – DSv1.0 Sep 01 '22 at 03:56
  • I found a sas6bdat.py file in the folder \Anaconda\pkgs\pandas-1.1.3-py38ha925a31_0\Lib\site-packages\pandas\io\sas, is the the file I can use? how to use it? – DSv1.0 Sep 01 '22 at 07:01
  • i am not really sure how to use it, sorry. – Nick Sep 01 '22 at 12:19

1 Answers1

0

Anaconda should already include sas7bdat, it should be available in your base environment (see package list)

You can download sas7bdat wheel manually and then install it. See: https://stackoverflow.com/a/27909082/5304366

You can also use a portable Python scientific distribution (e.g. WinPython) that may include sas7bdat.

You could probably also setup a local/private pypi server that would allow you to pip install any package. But I guess it is more work.

Adrien Pacifico
  • 1,649
  • 1
  • 15
  • 33
  • I found a sas6bdat.py file in the folder \Anaconda\pkgs\pandas-1.1.3-py38ha925a31_0\Lib\site-packages\pandas\io\sas, is the the file I can use? how to install from here? – DSv1.0 Sep 01 '22 at 10:44
  • you should use pandas to read your file. `import pandas as pd ; df = pd.read_sas("your_file.sas7bdat")` then you can export it to text with `df.to_string()`. – Adrien Pacifico Sep 01 '22 at 11:34
  • I tried read_sas but for some files it gives error "length of values does not match length of index" that is why I tried sas7bdat. do you know how to resolve this problem "length of values does not match length of index"? – DSv1.0 Sep 01 '22 at 12:48