I build a cpython locally (Windows) with a fix to a problem with multiprocessing that I have, but I also need data science stack of packages like numpy, pandas, scipy, matplotlib, statsmodels and few others. When I try to install them the process appears quite cubersome for many packages and for scipy I wasn't able to resolve it after 3 days of trying.
I was thinking that it would be amazing if I can just replace python in my anaconda env, and use conda to install the packages I need. Is it possible to easily replace python with binaries I have or I need to wait while my fix is released with new Python version?
I was able to resolve my issue by replacing only python DLL that I had in, and the conda environment just worked with it
Related
As someone who just got into data science (no prior coding history) I am new to using terminals, Python, and coding in general. While I do have some basic Python knowledge now, and I want to work on my first machine learning project, I am looking to use some packages that are not standard to python or jupyter lab, namely: TensorFlow.
After much struggle I was able to download TensorFlow in my terminal (i'm on Mac). Yet when I try to import to module I come to the following problem:
when I create a new file in jupyterlab (accessed via Anaconda) I have the option to create a python file using python 3 or python 3.7.2. When using python 3, I have access to packages to sklearn, SciPy, yet no TensorFlow. Then when I create a 3.7.2. file I can import the TensorFlow package, yet I cannot import the sklearn and SciPy packages anymore....
Did someone experience similar problems? Are there ways to solve this?
P.s. Using the 'pip install ...' command in terminal only sees to work rarely. Or I must be something wrong.
Thanks in advance,
John
If you willing to use condam then the easiest way is to install this package with conda:
conda install packagename
You may search what there is available before installing:
conda search packagename
Otherwise, if you still want to use conda with pip, checkout Using Pip to install packages to Anaconda Environment
I know what you are going through as even I went through a similar problem when I started. It seems that there are two different environments. One with Python3 and one with Python 3.7.2. The problem is arising because the modules are installed in different environments. Your TensorFlow module in Python 3.7.2 environment and sklearn modules in another environment.
It will better if you install all your modules in the base environment for ease in use.
I hope this helps.
I just got a new computer, and I was installing some Python libraries. When I tried to install numpy, I got a message on the console saying numpy was already downloaded. I went into the library folder, and not only was numpy there, but scipy, matplotlib, and a bunch of other libraries as well. How is this possible, considering this computer is brand new? I had installed Python the previous evening, so does installing Python automatically install these libraries as well?
It depends on which Python package you install.
On any desktop oriented Linux distribution, installing the Python package will only install Python. And in practice, it is generally already installed.
On Windows (and perhaps OS X), you need to pick a Python bundle somewhere. Perhaps did you choose Anaconda, which AFAIK installs a lot of common Python libraries (as opposed to its light version Miniconda).
Python does not ship with these libraries unless you are using a pre-packaged distribution such as Anaconda.
If you copied your data from your previous computer to this one, you may have copied the python installation (and thereby the libraries you had installed before) in your appdata folder.
Another possibility is that you have install Anaconda, which is targeted especially at scientific things, and comes with numpy, scipy and some other things preinstalled.
Although this is not the place for these types of questions, yes, there is no need to install libraries, as most of the times when you download Python in a distribution, such as Anaconda, they are also included.
I have a question which is very similar to Import Error: No module named numpy but the answer to that question I do not believe would be appropriate for me, so I'm asking again.
This is my most recent effort after about six hours of trying to get modules to work in python (numpy is a dependency of something else), so I'm finally turning to SO. Part of efforts in the last six hours included installing the enthought distribution, as its large volume of libraries was highly advised for windows users. I've even thrown the location of numpy folder onto the path of environment variables just to exclude it as a possibility.
Windows, 64bit, Python 2.7
Since you are on windows, I highly recommend that you install ANACONDA. This way the environment variables are set automatically and you don't need to worry about anything else. There are many useful packages (e.g. numpy, sympy, scipy) which are bundled with anaconda.
Moreover, based on personal experience I can tell you that using pip on windows and compiling from source (you need visual studio) is a pain in the neck sometimes. That's why ANACONDA has been conceived.
Hope this helps.
For python versions > 3.4 ,do this
pip install numpy beacuse pip is python dependency which installs packages just like npm in js i.e. node.js
I am using openSUSE Leap 42.1 and do some data analysis work in python. Most of the python packages I use are available in the standard openSUSE repositories (e.g. obs://build.opensuse.org/devel:languages:python); however sometimes they aren't, whereas they are available in Anaconda. I would like to replace all of the python packages installed on my computer with those available through Anaconda.
Is it possible to just install Anaconda in parallel with the normal openSUSE packages or should I manually delete the packages I've installed? I know python is used heavily throughout the operating system so I probably don't want to deep clean the system of python before going the Anaconda route.
Has anyone done this before? I was unable to find any info on this on the Anaconda site, and I'm curious if there is a clean way to do this.
I read the anaconda documentation, and there is no evidence of anaconda packages replacing your openSUSE packages. There isn't a reason for it to do so. If I got it right, then Conda is very similar to ruby's gem and similar tools, which definitely don't replace the installed packages. I think you can feel free to install it next to your current packages. Also, you can specify the python and python package version in the anaconda envinroments, which is another thing which it allows you to do, so you can decide what you will use there. Note, I'm not a conda user, this is how I understood the docs. Hope this helps.
Hi I'm trying to install matplotlib on my mac. I have lion OS X.
my python version is 2.7.1 ( this is what it says when I run it from terminal)
every time I install matplotlib, it promots this error
matplotlib 1.1.0 cannot be installed on this disk. matplotlib requires System python 2.7 to install.
I'm new to the python world and I need a tool to graph a few things... so a clear explanation is much appreciated.
Thanks!
You are installing a binary package which is going to expect a specific system python. You are better off building from source.
Just try installing it from pip:
pip install numpy
pip install matplotlib
If you do not yet have pip, you can install it like this:
wget "http://peak.telecommunity.com/dist/ez_setup.py"
python ez_setup.py
easy_install pip
If any of this fails, then follow #Nolen Royalty's guide that he mentioned in the comments
I've tried installing python in various different ways to get numpy, scipy, and matplotlib to all work together, and its a huge pain. Your exact version of python will dictate the version of numpy, scipy, and matlplotlib that will work for you.
By far, the easiest solution I have found is to use the pre-built package Enthought. It takes care of all of those problems with one easy installer. You might get some additional software installed like mayavi (an interactive 3d plotting tool), but its not too much.
If you are a student (or have ever been one since the dawn of email), you can download the entire Enthought package for free here. Or you can visit the Enthought home at www.enthought.com. All you have to do is select the academic license and then insert a email that ends in .edu.
I even think there are free trial versions which should solve the issue. I've never tried any of the trial versions, but even if it is a limited time trial, you should be able to use the trial version, and then see exactly which versions of each package you need to install. Its a little more roundabout, but it should work.
I tried to install numpy, scipy, and matplolib on my Mac Book Pro running Lion many times and they all failed. Nolen's recipe cam pretty close, but some of the matplotlib tests were failing in strange ways. The method that worked for me can be found on the page Installing Python, virtualenv, NumPy, SciPy, matplotlib and IPython on Lion
Since you list you are new to Python, I recommend installing matplotlib with MacPorts. First install macports
http://www.macports.org/install.php
then execute
port install py27-matplotlib
A couple of years ago there were some extra steps, but now it is this simple. You need to make sure you set your environment for the macports python, but that is provided in the documentation.
Have Fun!