EzDevInfo.com

anaconda

Anaconda turns your Sublime Text 3 in a full featured Python development IDE including autocompletion, code linting, IDE features, autopep8 formating, McCabe complexity checker and Vagrant for Sublime Text 3 using Jedi, PyFlakes, pep8, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3 Anaconda, the Python IDE for Sublime Text 3 anaconda is an autocompletion, liniting, code analyzer and ide for sublimetext 3

Bulk package updates using Conda [Anaconda]

I've been playing around with both Anaconda and Canopy. While I love the Spyder , object inspector etc integration in Anaconda I admire the graphical package manager and ability to perform bulk updates in Canopy.

So is there a way (using conda update) that I can list outdated packages and select or bulk update (compatible) packages in Anaconda?

It doesn't make much sense updating the packages individually as there are hundreds of them.


Source: (StackOverflow)

How to activate an Anaconda environment

I'm on Windows 8, using Anaconda 1.7.5 64bit.

I created a new Anaconda environment with

conda create -p ./test python=2.7 pip

from C:\Pr\TEMP\venv\.

This worked well (there is a folder with a new python distribution). conda tells me to type

activate C:\PR\TEMP\venv\test

to activate the environment, however this returns:

No environment named "C:\PR\temp\venv\test" exists in C:\PR\Anaconda\envs

How can I activate the environment? What am I doing wrong?


Source: (StackOverflow)

Advertisements

How to install 2 Anacondas (Python 2.7 and 3.4) on Mac OS 10.9

I'm relatively new in Mac OS. I've just installed XCode (for c++ compiler) and Anaconda with the latest Python 3.4 (for myself). Now I'm wondering how to install properly second Anaconda (for work) with Python 2.7?

I need both versions to work with IPython and Spyder IDE. Ideal way is to have totally separate Python environments. For example, I wish I could write like conda install scikit-learn for Python 3.4 environment and something like conda2 install scikit-learn for Python 2.7.

Any suggestions and hints?


Source: (StackOverflow)

Anaconda vs. EPD Enthought vs. manual installation of Python

What are the relative merits / downsides of various Python bundles (EPD / Anaconda) vs. a manual install?

I have installed EPD academic, and I have no issues with it. It provides more packages that I think I will ever need, and it is very easy to update using enpkg enstaller. The EPD academic licence requires yearly renewal however and the free version does not do updates as easily.

At the moment I really only use a handful of packages such as Pandas, NumPy, SciPy, matplotlib, IPython, Statsmodels and their respective dependencies.

For such limited use am I better off with manual install and pip install --upgrade 'package' or do the bundles offer anything over and above this?

UPDATE - 4 July 2013

I now use Enthought Canopy 1.0.3 at work on Windows XP, because it allows configuration of a network proxy in the preferences.

UPDATE - 22 July 2013

Anaconda has academic option available that allows free installation of accelerate and IOPro. Still no proxy access though.

UPDATE - 31 July 2013

After using all methods my view is that Continuum Anaconda is best for my purposes on Windows 8 64-bit. Conda is excellent and package installs/updates are so easy. As an aside, getting PyMC working would be nice, but I still have not achieved it.

UPDATE - 16 December 2013

ANACONDA at work behind firewall!!!

To get past a proxy server make a file called .condarc in your home directory and change the following settings to your own proxy requirements.

# Proxy settings
#  http://[username]:[password]@[server]:[port]
proxy_servers:
    http: http://user:pass@proxy.com:8080
    https: https://user:pass@proxy.com:8080

Source: (StackOverflow)

Create conda package across many versions

I have a very simple Pure Python package on PyPI that I'd like to make available on binstar. My package targets Python 2.6+ and 3.2+ with a single codebase. I also expect that it works equally well on Windows as well as Unix.

Is there a simple way to comprehensively build my package and upload it to binstar for many Python versions?

I've tried a naive use of conda skeleton pypi as suggested in this article. I'd like to replicate this process across many different versions.


Source: (StackOverflow)

Deploying to Heroku with Anaconda

I have a Django app I want to deploy to Heroku. I tried to follow the instructions here: https://devcenter.heroku.com/articles/getting-started-with-django which tells you to use virtual env.

However, I'm using Anaconda, which isn't playing nicely with virtual env. Has anyone deployed a Django app with Anaconda to Heroku and can lead me through the steps?


Source: (StackOverflow)

How to keep track of pip installed packages in an Anaconda (conda) env?

I've installed and been using the Anaconda python distribution, and I have started using the Anaconda (conda) envs. I can use the standard conda install... command to put packages from the distribution into my environments, but to use anything outside (i.e. Flask-WTF, flask-sqlalchemy, alembic) I need to use pip install in the active env. However, when I look at the contents of the env, either in the directory, or using conda list these pip installed packages don't show up.

Using pip freeze and pip list just lists every package I've ever installed.

Is there a way to keep track of what is in each of my Anaconda envs (both pip and conda installed)?


Source: (StackOverflow)

How to install Julia in an anaconda environment?

One of the main features of Anaconda is that it is language agnostic as stated in their blog:

You can create environments of any binary dependency tree (different versions of Python, R, Julia, etc.).

Recently I switched from using virtualenv to Anaconda in Python, so I was curious to try Julia in an Anaconda environment. However, I couldn't find instructions explicit enough to install Julia successfully. First, I tried naively conda create -n julia-test julia. Obviously, it didn't work. Then I found at binstar.org a Julia package (version 0.3) with the code

conda install -c https://conda.binstar.org/wakari1 julia

However, I don't want to install Julia outside of a specific virtual environment, so I changed it to:

conda create -n julia-test -c https://conda.binstar.org/wakari1 julia

It didn't throw errors but ultimately failed to start the Julia interpreter.

So, what is the correct way of installing Julia (0.2, preferably) in an anaconda environment?

UPDATE

In a recent blog post, Continuum announced that conda is starting to provide support for R packages:

We are bringing conda’s power to the R ecosystem by building conda packages for R and the R packages on CRAN. The support is still preliminary, but we plan to have full support for the full ecosystem in the coming months.

Maybe this is also good news for Julia and its package ecosystem.


Source: (StackOverflow)

Python crash with minimal Cython module (Python3, Anaconda3, Windows7)

I try to use Cython with Python3 (Anaconda3) under Windows 7. After having solved a bug in distutils by editing the file cygwinccompiler.py (cf. Building minimal cython file with python 3.3 (Anaconda) under windows 7), modules can be built without any problems:

C:\path\testcython> python setup.py build 
running build
running build_ext
cythoning testcython.pyx to testcython.c
building 'testcython' extension
C:\Prog\Anaconda3\Scripts\gcc.bat -mdll -O -Wall -IC:\Prog\Anaconda3\include -IC
:\Prog\Anaconda3\include -c testcython.c -o build\temp.win-amd64-3.4\Release\tes
tcython.o
writing build\temp.win-amd64-3.4\Release\testcython.def
C:\Prog\Anaconda3\Scripts\gcc.bat -shared -s build\temp.win-amd64-3.4\Release\te
stcython.o build\temp.win-amd64-3.4\Release\testcython.def -LC:\Prog\Anaconda3\l
ibs -LC:\Prog\Anaconda3\PCbuild\amd64 -lpython34 -lmsvcr100 -o build\lib.win-amd
64-3.4\testcython.pyd

However, as soon as there is an import or a print statement in the .pyx file, the produced .pyd file makes Python crash. For example, if testcython.pyx contains

def say_hello_to(name):
    print('Hello '+name)

it gives

In [1]: import testcython # no crash here

In [2]: testcython.say_hello_to('Tom')
Hello Tom

Here the "Python.exe has stopped working" window pops up and it's finished.

In that kind of situation (crash without error log, segmentation fault I suppose), what can I do to understand the problem?

Does anyone understand what happens here with Cython, Python 3 (Anaconda3) under Windows?

PS: no problem with Python 2.7 (Anaconda).


Edit: traceback produced by the module faulthandler

If testcython.pyx just contains:

print('Test print... Will it crash?')

or

import mod # where mod.py is a nearly empty module in the working directory

or

import sys

python crashes and I get:

$ python -X faulthandler -c 'import testcython'
Test print... Will it crash?
Fatal Python error: Segmentation fault

Current thread 0x000013e0 (most recent call first):
  File "<frozen importlib._bootstrap>", line 321 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1715 in load_module
  File "<frozen importlib._bootstrap>", line 539 in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1161 in _load_backward_compatible
  File "<frozen importlib._bootstrap>", line 1191 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 2226 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 2237 in _find_and_load
  File "<string>", line 1 in <module>

Source: (StackOverflow)

Installing Anaconda into a Virtual Environment

I've currently got a working installation of the Enthought Python Distribution on my machine that I don't want to necessarily disrupt, but I'd like to look at moving over to Anaconda from Continuum.

I can easily install anaconda into the virtualenv directory I create, but I'm not sure how to tell that virtualenv to use the anaconda-version of Python. If I was telling my whole system to use it I can alter .bash_profile with something like export PATH="/DIRECTORIES/anaconda/bin:$PATH. Is there a way to do that within a virtualenv?


Source: (StackOverflow)

Repositories of conda recipes and packages

From what I understand, there are several repositories for conda recipes (not for the program itself):

My questions are:

  • What is the relationship between them? Is any of them more "official" than the others? (in the same way that Pypi is for pip)
  • How can I tell conda to pull packages from the GitHub repository above?
  • Binstar.org, seems to be a hosting service for package repositories. How can I tell conda to search for packages in it?

Source: (StackOverflow)

How to install python opencv through Conda?

I'm trying to install opencv for python through anaconda, but I can't seem to figure this out.

I tried

conda install opencv
conda install cv2

I also tried searching

conda search cv

No cigar. I ran across this which lists opencv as an included package:

http://docs.continuum.io/anaconda/pkgs.html

After running conda info I noticed my version is 3.4.1 but I couldn't seem to find any information about this version online. I'm pretty confused about this.

Am I missing something pretty obvious here? If opencv was available for a previous version of anaconda, then why wouldn't it be available for the newer version? And why does that link only show me docs for version 1.9.2?


Source: (StackOverflow)

Anaconda not finding my packages installed with `pip`

I'm new to Anaconda version of Python, and already I'm running into unpleasant problems.

I installed Anaconda per the instructions here, and it worked like charm, with all the included packages imported properly when demanded. Then I went on to install some extra packages which Anaconda did not included in the first place with pip:

$ sudo pip install BeautifulSoup mrjob pattern

The installations seems to be perfect, but when I try to import them in ipython, things get frustrating:

Python 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18) 
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import BeautifulSoup
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-aa1e12a76f5e> in <module>()
----> 1 import BeautifulSoup

ImportError: No module named BeautifulSoup

In [2]: import mrjob
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-6ea1b9bda48b> in <module>()
----> 1 import mrjob

ImportError: No module named mrjob

In [3]: import pattern
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-4b662941bac1> in <module>()
----> 1 import pattern

ImportError: No module named pattern

In [4]: 

Funny thing is, these packages can be very well imported when I'm not running the Anaconda bundle of python, after removing

# added by Anaconda 1.8.0 installer
export PATH="/home/username/anaconda/bin:$PATH"

from my .bashrc:

Python 2.7.5+ (default, Sep 19 2013, 13:48:49) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import BeautifulSoup

In [2]: import mrjob

In [3]: import pattern

In [4]: 

Did I miss anything during any of these installations that I ran? Should I manually link these packages to Anaconda so that it knows where to find them?


Source: (StackOverflow)

Using (Ana)conda within PyCharm

I've got Pycharm 4 running on my Linux (Ubuntu 14.04) machine. In addition to the system python, I've also got Anaconda installed. Getting the two to play nicely together seems to be a bit of a problem... PyCharm provides some interesting integration for virtualenvs and pip, but the Anaconda Python distribution seems to prefer using its own conda tool for both activities.

Is there a relatively simple/painless way to be able to use conda in conjunction with PyCharm? Not just as an alternative interpreter i.e. point PyCharm at the Anaconda Python binary for a project interpreter, but to be able to create, source/activate and deactivate virtual envs, add/remove packages in those virtual envs, etc.

Or am I going to have to choose between using Anaconda (and having a more recent and up-to-date python than may come with the system), and being able to use PyCharm's features to their fullest extent?


Source: (StackOverflow)

Does anaconda create a separate PYTHONPATH variable for each new environment?

I am starting to work with the Anaconda package from Continuum.io to do scipy work. I have been able to get anaconda up and running, but I cannot tell whether anaconda creates a new PYTHONPATH environment variable for each new environment it creates, or whether it relies on the common system PYTHONPATH? I could not find any information on this in the documentation. Further, when I did a printenv, I did not see a PYTHONPATH variable in the newly created environment--though I did find a few new anaconda created environment variables. The best I can find is that anaconda added some anaconda directories and the new environment directory to the head of PATH variable--but this does not necessarily isolate the new package from the system environment but it is close. Does anyone know the answer to this question or found a way to deal with this concern.


Source: (StackOverflow)