0

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

2 Answers2

1

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

0

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.

  • Alright. That sounds logical. How can I make sure the TensorFlow package is installed to the python 3 base environment rather than the python 3.7.2.? Do you know how? – John van de Ven May 17 '20 at 11:12
  • use pip/conda list to find out all the modules installed in a particular environment. Use this command for both the environments. – Mayank Gupta May 17 '20 at 17:03