Installing anaconda to use with windows - python-2.7

I am lost in the installation process of installing anaconda on windows.
I've installed the windows 32bit package (I'm running windows 7 x64)
I have anaconda in the start menu and I can open the python console and use scipy.stats.t.interval(), the function I am interested in.
However, how do I go about including this in another python program? I think it's something like adding it to the path. For instance, I have the scipy.stats.t.interval() function call in my other python file which I run through cygwin via python myscript.py. However it returns the error:
from scipy.stats import t
ImportError: No module named scipy.stats
I think it might be a change of path / add to path issue, but I'm not sure how to fix it :/. While I try to fix it, I figure I will post for help here.

well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing :
which python
from CygWin console.
If it returns:
/usr/bin
then it is definitely a add-to-path problem.
to fix it for CygWin,
you have to add the python installation from anaconda to the path.
try this fromn CygWin:
PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH
and then doing:
which python
should give you:
/path-to-anaconda/anaconda/bin
and then it will work.
Cheers

Related

Anaconda error after install on Windows

I want to install Anaconda on my x64 Windows machine, and I downloaded the Python 2.7 version 64-bit installer. The installation process looks good.
Then I installed pip with choco and installed several packages like zbar,
however, when I want to try to launch Anaconda, I entered conda in Powershell, this is what I got:
Traceback (most recent call last):
File "C:\Users\Ruiyang\Anaconda2\Scripts\conda-script.py", line 3, in <module>
import conda.cli
ImportError: No module named conda.cli
Does anyone knows how to fix this?
add anaconda's bin directory to path.
set path=whatever\anaconda\bin;path;
This issue is related to the path variable setting. Quoting from another SO post:
fire up your interpreter and add this line: export PATH=/Users/add
your username here/anaconda/bin:$PATH
Now type python into the interpreter and you will see Anaconda 1.8.0
or whatever version you have. You will have to do this each time you
start a new interpreter.
Also, note that this might occur when the user name in the path on windows contains a space character. Taken from here.
Though #devautor's method doesn't work for me, a comment in his reference shows me the correct answer:
Unset both PYTHONPATH and PYTHONHOME, then my problem is solved.

Spyder will not launch on Ubuntu 16.10

I have installed python 2.7, 3.5, Anaconda2 and Anaconda3. I cannot get spyder v3.01, 3.00, 2.3.9, or 2.3.8 to launch in any of these environments. From the command line, typing spyder or even python spyder --reset result in
Segmentation fault (core dumped)
Has anyone else experienced this? Is there a fix?
Okay I finally figured out the problem, which likely only affects those who have first tried to install things like spyder in their default python distribution (even if this was later "removed"). The solution was first to start a python shell and check sys.path:
>>> import sys
>>> sys.path
Make sure all the listed paths are within your current python environment. For me, all paths included my anaconda installation path except one, which started with /home/jack/.local. Not sure how that got in there. Removing this from the path (using sys.path.pop() or sys.path.remove() in python fixed the problem.
To permanently fix the problem, I simply removed the "leftovers" from previously installed python packages that were hanging around in my .local directory. Now everything is great.
Thanks to Carlos Cordoba for the hints, and (more importantly) for spyder!
Cheers!

tkinter not installed properly in Anaconda Python 2.7 Win64

I believe from this post that this is not an uncommon issue with tkinter and new downloads of Python 2.7 (after re-downloading from 2016 on). I am using the Anaconda 2.7 for win64 on a Windows 7 machine. The filepaths seem almost identical to what is described here, except for "Anaconda2" instead of "Python27"; the "tcl" folder is in it's own directory in C:/Users/user:2312900/tcl and not in the "lib" directory.
Is there any way to fix this for Anaconda? That I tried what was described in the post, but it didn't work for me.
Is there any way to manually install a 64bit python 2.7 compatible wheel for tkinter? Does anyone know of any other packages to make simple GUI's with Python if this is an irreconcilable issue with the Annaconda distribution. I have a lot of other packages that were painfully installed that I do not want to use something else.
I am using Anaconda2 64bit and tkinter does indeed work, as I use it frequently. It might be something simple: can you import the package into your program? Try import Tkinter instead, i.e. with a capital 'T'.
Do you have user on your Windows called "user:2312900"? Python (and some other programs) don't like paths with special characters like colon ":". Try to install all your needed programs (Python, Tkinter, etc) in the path without special characters and without spaces " ".
For example: c:\ProgramData\Anaconda3\ or c:\Python27\

spyder, numpy, anaconda : cannot import name multiarray

I am on Windows 10, 64bits, use Anaconda 4 and I created an environment with python 2.7 (C:/Anaconda3/envs/python2/python.exe)
In this environment, I successfully installed numpy and when I type "python", enter, "import numpy", enter, it works perfectly in the anaconda prompt window.
In spyder however, when I open a python console and type "import numpy", I get "cannot import name multiarray". I have obviously changed the path of the python interpreter used by spyder to match the python.exe of the environment I created (C:/Anaconda3/envs/python2/python.exe). I also updated the PYTHONSTARTUP to C:/Anaconda3/envs/python2/Lib/site-packages/spyderlib/scientific_startup.py
It's supposed to be the exact same python program running but it's two different behavior. How is it possible and how to fix it ?
PS: I already tried the various solutions to this error like uninstalling numpy and reinstalling it. It shouldn't be a problem with numpy since it works just fine in the python console of the anaconda prompt window.
I solved the problem by executing the spyder version of the python2 environment.
It is located in Anaconda3\envs\python2\Scripts\spyder.exe
I have encountered same issue. I have followed every possible solution, which is stated on stack-overflow. But no luck. The cause of error might be the python console. I have installed a 3.5 Anaconda, and the default console is the python 2.7, which I have installed primarily with pydev. I did this and now it is working absolutely fine. Go to tools>preferences and click on reset to defaults. It might solve the issue. Or another solution is to uninstall the current Anaconda i.e. y.x and installing the correct one according to the default. In my case 2.7 Anaconda instead of 3.5

How can I change the version of python being used by IDLE?

I have both python 2.7 and python 3.4 installed on my mac.
IDLE is using the latter, how can I change that ?
I looked for idle in python2.7 folder under /Library/Python but all I can find under Python2.7 is a folder having the name site-packages.
you may try by changing the system variables....I don't know particularly about mac but in window we can do so.You may refer the following link.
=======================
https://www.youtube.com/watch?v=IX6mc9l6tY4