Python Forum
Anaconda Interpretor and Jypiter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anaconda Interpretor and Jypiter
#1
Hello, world!
Having installed 64-bit Anaconda-3 for Windows, I am trying to import numpy, pandas and matplotlib. The terminal window says that is not considered a outer or inner command. Leaving this question unsolved, I go to Jypiter notebooks and there do import all libraries. thus, the question, can I ignore the fact that the cmd is useless for the libraries and conduct all data science tasks from the notebooks alone? Thank ye.
Reply
#2
You most activate base environment when using it from command line.
Anaconda Prompt dos this automatic.
(Oct-21-2020, 03:54 PM)AMMras Wrote: can I ignore the fact that the cmd is useless for the libraries and conduct all data science tasks from the notebooks alone?
cmd is not the best,i use cmder.
So if i use cmder i activate Anaconda like this:
G:\Anaconda3
λ cd scripts

G:\Anaconda3\Scripts
λ activate

(base) G:\Anaconda3\Scripts
λ cd ..

(base) G:\Anaconda3
λ cd ..

(base) G:\
λ python -V
Python 3.7.3

(base) G:\
λ python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
>>> numpy.__version__
'1.16.2'
>>> exit()
So when see (base) it will always use Anaconda Python version.

Command line is important when programming so using something better that cmd/powershell,as cmder helps.
Reply
#3
Snippsat, thank you so much.
In fact, all libraries are given as active in Enviroments in the Anaconda Navigator.
But, with respect to the Scikit, it is not imported in the Jupiter at all (Numpy, Pandas, Seaborn were not imported in cmd, but they worked in Jupiter).
Reply
#4
part of Scikit does work in my Jupiter.
But another part does not.
If I code
from sklearn.
and then press TAB, there appears a set of methods, and no cross validation amongst them. Cross decomposition does appear.
But there remains the main question: if Jupiter is enough to make codes: so if I never import the libraries properly, and simply write a code with the help of Jupiter (where I see their outputs), it will still be a .py file able to process data?
Reply
#5
As I recall Jupyter creates files with ipnb extension (iPython Note Book). If the libraries are installed in your base environment you should be able to make .py files for your data analysis using Spyder or VSCode launched from Anaconda.
Reply
#6
(Nov-10-2020, 05:41 PM)AMMras Wrote: But there remains the main question: if Jupiter is enough to make codes: so if I never import the libraries properly, and simply write a code with the help of Jupiter (where I see their outputs), it will still be a .py file able to process data?

To tell the truth I don't fully comprehend the question. But one is clear - Jupyter files are .ipynb and not .py. In order to convert cells or snippets of code in notebook to .py one should use one of the magic commands.

To save cell content into .py file use %%writefile, to write set of lines use %save.

You can also do it in opposite direction i.e. loading from another file into notebook. For that there is %load

You can also run .py file inside notebook with %run
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#7
Hi there everyone!
I'm using jupyter notebook to practice python, but when I run and code it doesn't show the output. for example:

Marks = map(int,input("Enter Marks: ").split());

>>>>

it doesn't shown any output. how to fix this problem. Thanks in advance.
Reply
#8
add print(Marks) at end
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020