If I install anaconda, do I still have to use vscode? - python

I'm new in programming, actually I use it for Machine Learning.
I have installed python and anaconda (I don't know if that is right, or I have to install only anaconda?).
And I can see in start menu: (Anaconda powershell, Jupyter, Spyder, Anaconda navigator, Anaconda prompt).
So my question is: Do I still have to use vscode as IDE, or one of the listed programs that come with anaconda? If the answer is the second choice, I will ask, which one of them?
Thanks.
I'm using python just because I have a project in ML, So I must to set the necessary things for ML, like libraries, dataset, and algorithms. Then I have to learn how to use them.
Any help will be very apprecheated.

Anaconda is a Python distribution, that not only comes with Python itself, but a lot of additional Python packages from the "scientific stack", like numpy, pandas, matplotlib, scipy, scikit-learn: exactly what you need for ML. You don't have to install anything else from python.org.
Anaconda also comes with the Spyder IDE. This is the perfect choice for a Python beginner. You don't need VSCode. VSCode is way more flexible than Spyder, but you have to get used to it.
Conda is the package manager that comes with Anaconda. Do yourself a favour an learn some conda basics and how to use virtual environments here: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html
The important difference between Anaconda and pure Python is that you have to activate a conda environment - even the "base" environemnt - before you can use it. This is not obvious to a beginner.

If I were you I would use vcscode. Anaconda is only a python with extra features, but to code you would appreciate the VSCOde. It comes with many features and you can install extensions to burst your experience. Go for it.

Related

Tensorflow Installation Confusion

When I try to install TensorFlow using pip in the terminal (I'm on Mac), it says that I have it downloaded. The problem is when I try to use import tensorflow in pycharm it says that I do not have it installed. Please help.
Check your project interpreter on PyCharm. Based on your description, it seems like you might have installed TensorFlow on your base. If PyCharm's interpreter is using a different environment (that is not your base environment) to run Python, you will not be able to access TensorFlow. PyCharm allows users to configure environments and interpreters very easily.
I recommend that you use a virtual environment for your projects, since it allows you to manage different modules and installations more conveniently. For more information on Python virtual environments, refer to this post.
If anything is unclear, I'd be happy to elaborate.

Do I need Anaconda installed if I already have PyCharm? If so will they work well together?

So I have PyCharm install on my Mac. I just started a course that talks about using Anaconda but nothing about PyCharm. I'm still a beginner learning the language but I feel I need to start writing code while still studying. Do I need to install Anaconda even if I have PyCharm? And if so will they both work well together?
PyCharm is a development environment and Anaconda is an all-in-one way to install a nice stack of Python tools and packages (numpy, pandas, etc. - lots of data science tools but many general purpose tools as well). They work together fine - you just need to set up a run configuration that points to the Anaconda installation.
My experience with Anaconda was using it for a machine learning learning class. We used jupyter notebook to do all our learning and projects. From what I've noticed, people mostly use Anaconda for data science and machine learning related applications. But since you are just starting to learn python, I recommend just sticking with PyCharm.

Can Anaconda be used to create virtual environments for Go?

Anaconda is a powerful and popular toolkit normally associated to Python development. Its snake-name is probably chosen to remind of Python, but the feeling I get using it, is that all it does is handling virtual environments, pre-installing useful Python libraries, tools and packages, and then (and probably most importantly) dealing with dependencies and installations.
Can I set Anaconda up to create virtual environments for Go, too?
From the fact Anaconda can install Go, I get to think it's actually possible, but then I also get the feeling all dependencies-solving power of Anaconda is probably made thinking of Python only.
...Can it be done?
I also get the feeling all dependencies-solving power of Anaconda is probably made thinking of Python only.
Absolutely not. Anaconda installs Conda. Conda is a package and environment manager, and not just for Python, but also for R, Julia, Perl, Scala, etc... including Go.
You will need to create a new environment if you want to run Go:
conda create --name go --channel-name conda-forge go
Then move to the new environment to run go using:
activate go
Since Go supports vendoring, you can use an utility like https://github.com/golang/dep to have all dependencies in the project.

Running pip3 on MacOS Sierra (Python newbie) - do I need a virtualenv?

I'm running MacOS Sierra 10.12.6
By default the system came with Python 2.7.10
I installed Python 3.6.3 (with IDLE) so I can learn Python (3). I understand that this is normal as MacOS may rely on Python 2.x for some programs. Either way, Python3 runs just fine if I run python3 from the command line/terminal, or if I use IDLE (which defaults to Python 3).
Now I want to install some libraries like Beautiful Soup.
And I believe I can install it as follows:
pip3 install beautifulsoup4
which should automatically install it. However, I read that it's recommended to use virtualenv on Mac BEFORE I run the above command. As a newbie, I don't want to mess anything up on my PC, so can anyone point me out how I can do this correctly?
For example, I can follow this link: http://sourabhbajaj.com/mac-setup/Python/virtualenv.html
But I just want to write here to make sure I'm following the right article/commands before I do it. Just being super careful!
Also, can I make a folder with my "virtual environment" and then add sub-folders inside that for each project? Meaning, I don't need to do this everytime, I have one virtual environment and any project that I do just is a subfolder within that space so I can use any libraries that I installed. Just trying to grasp the concept.
Thanks!
Sorry to add confusion.. this can be a tough subject for someone starting out.
The official docs recommend venv, which is similar to, but slightly different than virtualenv.
I would strongly recommend pycharm. It will create your venv for you as part of your project, which you might find helpful.
[Edit: Some other virtual environment features of pycharm that will help you].
If you type in an import statement for a package that isn't installed, it will offer to install it for you.
typing alt-F12 will bring you up a console with your virtual environment active
It syncs up your requirements.txt document for you
It manages your virtual environment path for you (as long as you are running inside pycharm), helping avoid import problems that many newcomers have with virtual environments.
I am not affiliated with pycharm, btw -- I just think it is a great tool for python developers, especially for newcomers, and its treatment of virtual environments is especially helpful.
You create one virtualenv for each project as a way of keeping track of the specific dependencies to keep them minimal which then makes it easier when you want to share projects with other people.
But this is not something you need. No harm comes from installing packages in your real environment as well. So you can safely run
pip3 install beautifulsoup4

Package not found in python, despite loading jupyter notebook from environment w/package

I have a fresh installation of Anaconda on OS X, and I'm following the instructions on this page to the letter, in order to create the appropriate environment.
When I enter conda list after activating the environment, pandas and matplotlib are both listed.
But when I open the provided jupyter notebook, or when I create a new jupyter notebook and type import pandas as pd, I get a 'there is no module called pandas' error. Ditto for matplotlib.
Happy to provide any more information that would be helpful in figuring out the problem. I feel like I run into problems like this a lot, so general strategies for debugging this kind of thing are welcome. Thanks!
EDIT: OK, I've fixed the problem for now, but I still feel like I'm missing something.
The problem was that there was no jupyter/ipython notebook kernel for the version of python in this env. So when I launch the notebook, even within the env, the correct version of python doesn't load, and some packages aren't available.
The solution is to add the kernel as described here: Using both Python 2.x and Python 3.x in IPython Notebook
It seems a bit odd to have to install a different ipython-kernel for every environment, but maybe it's not. I guess I just thought the correct version of python would load in the notebook as long as the notebook was launched from the env.
Does anyone have a better solution?
Since both your Py2 and Py3 kernels need different, version specific sets of packages to support them, the best and most convenient solution seems to be the one it sounds like you followed -- use anaconda, install either version as your default, then install an env with the other. If you want pandas available to both versions, you will need to make sure you conda install it in both the root and the other env. Jupyter is a bit magical in that it can be launched from either environment, yet will recognize that an ipython kernel exists in a different env and make both available to you.
It sounds like this may have worked against you slightly, though, and that you either launched jupyter from an env that didn't have ipython installed, but did have pandas. Jupyter found the ipython kernel in the other env, but you didn't have pandas installed there yet. At lest thats a theory. Solution remains to install pandas and ipython in both. Doing conda install anaconda in both envs will give you lots of packages, if space isn't a concern and may save you some of this aggrivation.

Categories