I have coded some projects in processing that I would like to continue in python under the python port p5py/p5.
I am using Anaconda as my Python environment, but couldn't find a way of installing p5py/p5 via conda; installing p5py/p5 via pip works, but the library can't be imported into within Spyder in the Anaconda environment.
I have been able to install all libraries on which p5py/p5 depends from within Anaconda, which makes it a bit frustrating that I can't get p5 installed.
I would therefore appreciate any tips for making p5py/p5 importable from with the Anaconda environment.
As performance is currently not a pressing issue to me so suboptimal workarounds would also be of help.
Related
I have tried many times to install Pipetorch in Spyder 5.3 with Python 3.8.10, but it failed.
I have tried as well conda as pip commands, but it does not work. If I use %pip I get this:
Note: you may need to restart the kernel to use updated packages. C:\Users\szewa\AppData\Local\Programs\Spyder\Python\python.exe: No module named pip
If I use conda I get this:
`ValueError: The python kernel does not appear to be a conda environment. Please use ``%pip install instead.`
Can someone help me? I can find nothing on internet that works...
You seem to be confused about the differences between pip and conda. Anyhow, your Python installation is messed up now and only a restart will help now.
The easiest way to use Python together with the Spyder IDE is to install Anaconda and learn some conda basics: Getting started with conda.
If you really want to install Spyder with standard Python, follow the recipe from Spyder installation without Anaconda, but it seems to be tricky.
I am new to Python. I am a very old R programmer. One of my PhD courses is performed via Python.
So, I installed Jupyter Notebook; I wrote simple "Hello World" in Jupyter Notebook. I wonder whether I must install Anaconda or not?
I ask this because: I looked at Anaconda's IDE in youtube, and it shows RStudio, Jupyter Notebook, etc. in a bundled manner. In RStudio, one can perform all the package handlings within RStudio.
So, I wondered is there a way to install python packages within Jupyter Notebook, or should I really install Anaconda? What is the benefit of installing Anaconda (besides Jupyter Notebook)?
The packages in python are generally installed with "pip" (or "conda") in the terminal and are then available regardless where you run your script from. Assuming you don't have multiple python versions set up on your PC, they should then all be available in your jupyter-notebook also.
If you don't want to open another window to do this, you can also run BASH code from Jupyter itself, just start the line with an exclamation mark (!)
i.e.
!pip install pandas
The benefits of Anaconda are that it bundles everything you need to at least start your more basic projects (python release, basic packages, IDE) and that you can set-up project-specific environments that do not interfere with your system-wide package installations.
Python packages are not installed with python functions, like it would be the case in R with install.packages("package name"). Instead, an external package manager usually is used to install and possibly compile the package files to a directory where python can import it from.
Anaconda offers (among others) the package manager conda. Most popular is pip. Some Linux distributions also offer python packages via their package manager (e.g. apt on Debian/Ubuntu). All these package managers download packages from their own repositories, so conda install numpy, pip install numpy and apt install python3-numpy all install a package numpy, but from different sources and in possibly different versions.
Jupyter Notebook is a programming environment, where you can execute shell commands with !command, so depending on the system where the Jupyter server is running, you can use !pip install numpy, !conda install numpy or other commands as cells in the Jupyter Notebook you are working in. This will run the command in a shell.
That graphical menu with Jupyter, RStudio etc. you describe is the program "Anaconda Navigator", which is installed with Anaconda. Jupyter is just a Python library, which is pre-installed with Anaconda, but can also be installed via pip, apt and other package managers.
Like Virtualenv, Anaconda also uses the concept of creating environments so as to isolate different libraries and versions. Anaconda also introduces its own package manager, called conda, from where you can install libraries.
Additionally, Anaconda still has the useful interaction with pip that allows you to install any additional libraries which are not available in the Anaconda package manager.
It is a good option for setting up of a better environment for working with jupyter.
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.
As I already have quite a lot of packages installed without installing Anaconda will I have to reinstall them again separately? Or are they accessible in Anaconda environment because I have them preinstalled? There is a similar question which has the answer suggesting installing only miniconda but in my case Anaconda is necessary.
No, anaconda uses completely different environments and whatever downgrading it does, it does it within it's own environments. So, if you are using anaconda environments within your applications, you don't need to reinstall anything but if you are using another environment (like pip only) you need to make sure you have installed all the necessary packages there as well.
Also, if a package is installed using pip and not installed in conda, it will automatically switch to pip so there is no problem there.
Is there any benefit of using Anaconda for PyCharm instead of the standard python distribution for PyCharm?
Using Anaconda instead of standard Python will benefit you as Anaconda comes with preinstalled packages. A lot of time will be saved there since installing various packages and making them run gets irritating sometimes.
Also, since it will have preinstalled packages, it can be heavy for your system. You can try miniconda as an alternative where you install packages when required. It is still better than having Python only. You can even install Anaconda by using conda install anaconda
Pip installation of Python packages sometimes may cause few problems to the user and you need to constantly update the pip as well before installing any other python packages via pip. So using Anaconda will be a benefit in this case.