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
  How to import entire module ? tonycstech 4 255 Dec-01-2019, 01:53 AM
Last Post: quyenca
  When I import a Module it wont run PyNovice 17 562 Oct-26-2019, 11:14 AM
Last Post: PyNovice
  importin function vs. import module hikerguy62 2 247 Jul-28-2019, 03:13 PM
Last Post: ndc85430
  Can't import the CSV module loren41 1 407 May-31-2019, 10:05 PM
Last Post: Yoriz
  Python can't find module installed in anaconda iFunKtion 12 30,304 Mar-06-2019, 05:15 PM
Last Post: jwsmallz
  import module error german77 4 629 Feb-28-2019, 02:29 PM
Last Post: german77
  Python 3 Module Import Help Stealthychu 25 1,907 Oct-28-2018, 04:16 PM
Last Post: Larz60+
  module import error bobsmith76 4 837 Sep-18-2018, 03:41 AM
Last Post: bobsmith76
  I cannot import the module I built for pypi PeriGK 2 1,480 Apr-10-2018, 07:44 PM
Last Post: PeriGK
  python import sybpydb error: DLL load failed: The specified module could not be found andieDu 3 2,505 Apr-04-2018, 06:58 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)