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.
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.
I 'm a Chinese student, When I use pip to update and install, problems like this always occur. My computer is Windows 64.
E:\>python -mpip install —upgrade Pip
Collecting pip
Downloading https://files.pythonhosted.org Packages 'c2 d7 D0f34c60d83a6c5631cf71dfe64cc1054598c843e0211400e55675c. pip-18.1 -PYS.py3 -none -any.whl (1.3MB)
-----------------100% 1.3MB 155kB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Rolling back uninstall of pip
File"C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\configparser.py", line 1079, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'setup.cfg', line: 1
'<?xml version="1.0" encoding="utf-8"?>\n'
I googled it and it seems to be a BOM error, but how could I deal with it?
Update:
As Adam Smith commented correctly, this doesn't solve the real issue, which looks like a byte-sequence error in the setup.conf file.
As kintoki stated, you can try the very popular Miniconda as your environment, which solves a lot of issues with Python on Windows, but a small caveat is that new version for packages might take some time until you can install them. It is very popular in the data-science community.
I am looking for a more proper answer and will update it here.
Original:
Pip and Windows don't always work well together. The best way to get around that is to download the packages you want to as pre-compiled binary whl files, directly from University of Califonia, Irvine python package index for Windows.
Then you can install them directly with pip! And don't forget that pip in itself is a package inside pip (inception?)
Assuming you want to install pip 18.1, download this whl file and then run it like so:
pip install pip‑18.1‑py2.py3‑none‑any.whl
This will work the same way for any other python package as well. Just search and download the correct version matching your python version.
Okay, so, I'm running Python 3.4.3 with pip 9.0.1, with the setuptools and wheel.
I'm running this inside JetBrains PyCharm Professional 2017.2.3.
The issue I'm having is trying to install the twitter api packages from this tutorial (ya I'm a n00b) http://wiki.openhatch.org/Twitter
I'm struggling with installing the 4 dependencies mentioned in the first part of the tutorial (httplib2, simplejson, oauth2 and python-twitter)
Honestly, I'm just getting back into programming and this is a project I'd like to complete.
So, I need help with:
Installing pip, and how to use it, and where (python shell or command line or)
the dev.twitter.com website (and where to find what I need from there)
Any help is massively appreciated and sorry if I sound really n00by, but do correct me where I'm using incorrect terms etc because that's how I learn I guess :)
If you haven't got pip installed, find your python installation file.Execute it and choose 'Change Python Installation'. Now choose 'pip' to install and 'add python.exe to path'. Wait for it to finish. Now run windows command line and type:
pip install package_name
Sometimes you may experience that a package isn't available on pip or doesn't work.There are 2 common (not always working) ways to install a package without making pip download the file:
1) A package may be available as a .whl file for download.Download it.Now find it and copy its name .Open a command line in dictionary where it is located and type
pip install **now paste the filename and add .whl**'
2)A package is available as a zip file.Packages are often packed into a zip file.Download the file and extract it.Open a command line in it's directory.You may see setup.py file.Run
python setup.py install
When finished installing pip and adding python to path,you can run:
pip install httplib2 simplejson oauth2 python-twitter
Done.
Once you have pip installed, open the command prompt and just type pip install name_of_the_extension.
In this case, pip install httplib2 will install this package.
I believe you have pip installed on your computer, so it shouldn't be a problem to install the 4 packages you need.
I have Python 2.7, and I have distutils installed.
I downloaded the latest version of Scipy for win 32.
For the life of me, I do not understand how to install it.
From the directions on the site, it states:
If you already have Python installed, the easiest way to install Numpy
and Scipy is to download and install the binary distribution from
Download.
I have followed the above directions and downloaded this.
I cannot figure what to do now!
How do I finish getting scipy installed?
It looks like you've downloaded the source distribution, which you would normally install by doing:
python setup.py install
However, without the proper C compiler environment and other libraries, it will probably fail. I'm guessing you really wanted to download the Windows binaries .
You have to drill a little further down in the sourceforge site to find it.
try downloading the windows binary ...
http://sourceforge.net/projects/scipy/files/scipy/0.11.0/scipy-0.11.0-win32-superpack-python2.7.exe/download
You'll be well off installing setuptools. Makes installing almost anything python-related a breeze!
e.g.
easy_install scipy
There's another one called pip.
easy_install pip
pip install scipy
just open windows command prompt and go to the directory you have installed Python. e.g
c:\python34>
Once there, just type python -m pip install scipy and press enter
A tweet reads:
Don't use easy_install, unless you
like stabbing yourself in the face.
Use pip.
Why use pip over easy_install? Doesn't the fault lie with PyPI and package authors mostly? If an author uploads crap source tarball (eg: missing files, no setup.py) to PyPI, then both pip and easy_install will fail. Other than cosmetic differences, why do Python people (like in the above tweet) seem to strongly favor pip over easy_install?
(Let's assume that we're talking about easy_install from the Distribute package, that is maintained by the community)
From Ian Bicking's own introduction to pip:
pip was originally written to improve on easy_install in the following ways
All packages are downloaded before installation. Partially-completed installation doesn’t occur as a result.
Care is taken to present useful output on the console.
The reasons for actions are kept track of. For instance, if a package is being installed, pip keeps track of why that package was required.
Error messages should be useful.
The code is relatively concise and cohesive, making it easier to use programmatically.
Packages don’t have to be installed as egg archives, they can be installed flat (while keeping the egg metadata).
Native support for other version control systems (Git, Mercurial and Bazaar)
Uninstallation of packages.
Simple to define fixed sets of requirements and reliably reproduce a set of packages.
Many of the answers here are out of date for 2015 (although the initially accepted one from Daniel Roseman is not). Here's the current state of things:
Binary packages are now distributed as wheels (.whl files)—not just on PyPI, but in third-party repositories like Christoph Gohlke's Extension Packages for Windows. pip can handle wheels; easy_install cannot.
Virtual environments (which come built-in with 3.4, or can be added to 2.6+/3.1+ with virtualenv) have become a very important and prominent tool (and recommended in the official docs); they include pip out of the box, but don't even work properly with easy_install.
The distribute package that included easy_install is no longer maintained. Its improvements over setuptools got merged back into setuptools. Trying to install distribute will just install setuptools instead.
easy_install itself is only quasi-maintained.
All of the cases where pip used to be inferior to easy_install—installing from an unpacked source tree, from a DVCS repo, etc.—are long-gone; you can pip install ., pip install git+https://.
pip comes with the official Python 2.7 and 3.4+ packages from python.org, and a pip bootstrap is included by default if you build from source.
The various incomplete bits of documentation on installing, using, and building packages have been replaced by the Python Packaging User Guide. Python's own documentation on Installing Python Modules now defers to this user guide, and explicitly calls out pip as "the preferred installer program".
Other new features have been added to pip over the years that will never be in easy_install. For example, pip makes it easy to clone your site-packages by building a requirements file and then installing it with a single command on each side. Or to convert your requirements file to a local repo to use for in-house development. And so on.
The only good reason that I know of to use easy_install in 2015 is the special case of using Apple's pre-installed Python versions with OS X 10.5-10.8. Since 10.5, Apple has included easy_install, but as of 10.10 they still don't include pip. With 10.9+, you should still just use get-pip.py, but for 10.5-10.8, this has some problems, so it's easier to sudo easy_install pip. (In general, easy_install pip is a bad idea; it's only for OS X 10.5-10.8 that you want to do this.) Also, 10.5-10.8 include readline in a way that easy_install knows how to kludge around but pip doesn't, so you also want to sudo easy_install readline if you want to upgrade that.
Another—as of yet unmentioned—reason for favoring pip is because it is the new hotness and will continue to be used in the future.
The infographic below—from the Current State of Packaging section in the The Hitchhiker's Guide to Packaging v1.0—shows that setuptools/easy_install will go away in the future.
Here's another infographic from distribute's documentation showing that Setuptools and easy_install will be replaced by the new hotness—distribute and pip. While pip is still the new hotness, Distribute merged with Setuptools in 2013 with the release of Setuptools v0.7.
Two reasons, there may be more:
pip provides an uninstall command
if an installation fails in the middle, pip will leave you in a clean state.
REQUIREMENTS files.
Seriously, I use this in conjunction with virtualenv every day.
QUICK DEPENDENCY MANAGEMENT TUTORIAL, FOLKS
Requirements files allow you to create a snapshot of all packages that have been installed through pip. By encapsulating those packages in a virtualenvironment, you can have your codebase work off a very specific set of packages and share that codebase with others.
From Heroku's documentation https://devcenter.heroku.com/articles/python
You create a virtual environment, and set your shell to use it. (bash/*nix instructions)
virtualenv env
source env/bin/activate
Now all python scripts run with this shell will use this environment's packages and configuration. Now you can install a package locally to this environment without needing to install it globally on your machine.
pip install flask
Now you can dump the info about which packages are installed with
pip freeze > requirements.txt
If you checked that file into version control, when someone else gets your code, they can setup their own virtual environment and install all the dependencies with:
pip install -r requirements.txt
Any time you can automate tedium like this is awesome.
pip won't install binary packages and isn't well tested on Windows.
As Windows doesn't come with a compiler by default pip often can't be used there. easy_install can install binary packages for Windows.
UPDATE: setuptools has absorbed distribute as opposed to the other way around, as some thought. setuptools is up-to-date with the latest distutils changes and the wheel format. Hence, easy_install and pip are more or less on equal footing now.
Source: http://pythonhosted.org/setuptools/merge-faq.html#why-setuptools-and-not-distribute-or-another-name
As an addition to fuzzyman's reply:
pip won't install binary packages and isn't well tested on Windows.
As Windows doesn't come with a compiler by default pip often can't be
used there. easy_install can install binary packages for Windows.
Here is a trick on Windows:
you can use easy_install <package> to install binary packages to avoid building a binary
you can use pip uninstall <package> even if you used easy_install.
This is just a work-around that works for me on windows.
Actually I always use pip if no binaries are involved.
See the current pip doku: http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install
I will ask on the mailing list what is planned for that.
Here is the latest update:
The new supported way to install binaries is going to be wheel!
It is not yet in the standard, but almost. Current version is still an alpha: 1.0.0a1
https://pypi.python.org/pypi/wheel
http://wheel.readthedocs.org/en/latest/
I will test wheel by creating an OS X installer for PySide using wheel instead of eggs. Will get back and report about this.
cheers - Chris
A quick update:
The transition to wheel is almost over. Most packages are supporting wheel.
I promised to build wheels for PySide, and I did that last summer. Works great!
HINT:
A few developers failed so far to support the wheel format, simply because they forget to
replace distutils by setuptools.
Often, it is easy to convert such packages by replacing this single word in setup.py.
Just met one special case that I had to use easy_install instead of pip, or I have to pull the source codes directly.
For the package GitPython, the version in pip is too old, which is 0.1.7, while the one from easy_install is the latest which is 0.3.2.rc1.
I'm using Python 2.7.8. I'm not sure about the underlay mechanism of easy_install and pip, but at least the versions of some packages may be different from each other, and sometimes easy_install is the one with newer version.
easy_install GitPython