Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 2 versions of module installed, how to import the earlier one
#1
Please, help: I want to work with fbprophet and I had error, which I think will be solved if I will use earlier version of numpy.
What I did: I removed numpy and installed numpy 1.15.4.
But when I wrote:
import numpy
print(numpy.__version__)
It is written that I still have version of numpy 1.16.3

Is there code, something like "import numpy=1.15.4"?
Quote
#2
pip install --force-reinstall numpy==1.15.4
will replace current version. Careful, other version will be gone when done!

Be aware, that based on your comments, it looks like you have more than one version of python installed.
check version with:
python -V
# then make sure pip matches python
pip -V
# finally pip list to show versions of software installed
Quote
#3
(Oct-20-2019, 06:31 PM)Larz60+ Wrote: pip install --force-reinstall numpy==1.15.4
will replace current version. Careful, other version will be gone when done!

Be aware, that based on your comments, it looks like you have more than one version of python installed.
check version with:
python -V
# then make sure pip matches python
pip -V
# finally pip list to show versions of software installed

Thank you for your answer!
1) I use anaconda, can you please write code for anaconda? fbprophet doesn`t work without anaconda
My code was
conda remove numpy
conda install numpy==1.15.4
After that code:
I still had version of numpy 1.16.3 and anaconda stopped work, so I reinstalled anaconda

2)I have only one version of python: 2.7. I think this is because I have python and I have anaconda
Quote
#4
sorry, I don't use conda, but google search shows:

conda install numpy=1.4.3
with a single '='
Quote
#5
(Oct-20-2019, 09:13 PM)Larz60+ Wrote: sorry, I don't use conda, but google search shows:

conda install numpy=1.4.3
with a single '='

It doesn`t matter as after my code it showed that numpy version was installed successfully
Quote
#6
The problem was solved by deleting .condarc file of anaconda and repeating code
conda remove numpy
conda install numpy=1.15.4
However, I still do not know the answer to my question "2 versions of module installed, how to import the earlier one". Maybe I will need to know the answer in the future
Quote
#7
You just used the command. just specify the version number you want to install in place of the 1.15.4
Quote
#8
(Oct-22-2019, 04:20 AM)Larz60+ Wrote: You just used the command. just specify the version number you want to install in place of the 1.15.4

What do you mean by saying that? The question was how to import, not install
Quote
#9
Use virtual environment as this is one of the task it can solve.
Anaconada has own tool for tool for this trough conda(Package, dependency and environment management for any language)

Example.
First install C++ compiler support.
conda install libpython m2w64-toolchain -c msys2
conda install numpy cython -c conda-forge
Now create virtual environment using conda.
λ conda create -n fb_env python=3.7
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: G:\Anaconda3\envs\fb_env

  added / updated specs:
    - python=3.7


The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/win-64::ca-certificates-2019.10.16-0
  certifi            pkgs/main/win-64::certifi-2019.9.11-py37_0
  openssl            pkgs/main/win-64::openssl-1.1.1d-he774522_3
  pip                pkgs/main/win-64::pip-19.3.1-py37_0
  python             pkgs/main/win-64::python-3.7.4-h5263a28_0
  setuptools         pkgs/main/win-64::setuptools-41.4.0-py37_0
  sqlite             pkgs/main/win-64::sqlite-3.30.0-he774522_0
  vc                 pkgs/main/win-64::vc-14.1-h0510ff6_4
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0
  wheel              pkgs/main/win-64::wheel-0.33.6-py37_0
  wincertstore       pkgs/main/win-64::wincertstore-0.2-py37_0


Proceed ([y]/n)? y
Activate:
λ conda activate fb_env

(fb_env) G:\Anaconda3
λ pip freeze
certifi==2019.9.11
wincertstore==0.2
Now install pystan(dependency requirement) and fbprophet.
Need also plotly.
(fb_env) G:\Anaconda3
λ pip install pystan
λ pip install fbprophet
λ pip install plotly
As it stuff has a lot dependencies this is now whats'a installed.
Use pip freeze
(fb_env) G:\Anaconda3\envs\fb_env
λ pip freeze
certifi==2019.9.11
convertdate==2.1.3
cycler==0.10.0
Cython==0.29.13
ephem==3.7.7.0
fbprophet==0.5
holidays==0.9.11
kiwisolver==1.1.0
lunardate==0.2.0
matplotlib==3.1.1
numpy==1.17.3
pandas==0.25.2
plotly==4.2.1
pyparsing==2.4.2
pystan==2.19.0.0
python-dateutil==2.8.0
pytz==2019.3
retrying==1.3.3
setuptools-git==1.2
six==1.12.0
wincertstore==0.2
Remember this is now all isolated from main Anaconda or any other python version.
So this will avoid version conflict with previsions install stuff.
Test that it work.
(fb_env) G:\Anaconda3\envs\fb_env
λ python
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from fbprophet import Prophet
>>> import pandas as pd
>>>
>>> Prophet
<class 'fbprophet.forecaster.Prophet
>>> dir(Prophet)
......
>>> exit()
(fb_env) G:\Anaconda3\envs\fb_env
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  pip list to show all versions of a package installed pvbadiger05b 4 194 May-21-2020, 06:48 PM
Last Post: jameshonest
  how to find module in installed packages keuninkske 3 249 May-09-2020, 10:21 PM
Last Post: keuninkske
  Unable to import my own module ThePhantom 3 246 May-01-2020, 01:30 AM
Last Post: menator01
  Error while humansize module import. johnkgson 3 415 Apr-26-2020, 08:37 AM
Last Post: johnkgson
  from module import function krishanu21 4 186 Apr-22-2020, 10:58 AM
Last Post: buran
  Importing module from a package results in import error goghvv 2 220 Mar-27-2020, 07:13 PM
Last Post: goghvv
  Import Module and Method ( dynamic ) ? JohnnyCoffee 0 151 Mar-23-2020, 04:23 PM
Last Post: JohnnyCoffee
  how to import a module which is installed to personal folder using pip install --pre? geekgeek 2 232 Mar-09-2020, 02:38 PM
Last Post: geekgeek
  module run on import? mcmxl22 3 242 Mar-02-2020, 04:37 PM
Last Post: mcmxl22
  Cannot import list from another module? t4keheart 1 186 Feb-17-2020, 10:25 PM
Last Post: t4keheart

Forum Jump:


Users browsing this thread: 1 Guest(s)