Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_resources.ContextualVersionConflict: numpy 1.14.0 #373

Open
ugurtigli opened this issue Nov 15, 2019 · 4 comments
Open

pkg_resources.ContextualVersionConflict: numpy 1.14.0 #373

ugurtigli opened this issue Nov 15, 2019 · 4 comments

Comments

@ugurtigli
Copy link

ugurtigli commented Nov 15, 2019

Environment

  • Operating System: Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
  • Python Version: Python 3.6.7
  • Python Bitness: 64
  • Python runtime: python is /opt/venv/bin/python
    python is /usr/bin/python
  • Python alias: alias python | grep python
  • Python packages: pip freeze
    tensorflow==2.0.0
    tensorflow-estimator==2.0.1
  • How did you install Stock Analysis Engine: pip
    • Are you using a virtualenv? yes
    • Are you using a pipenv? no
    • Are you using anaconda? no
  • Are you running outside docker or inside containers?
    inside docker
    Now that you know a little about me, let me tell you about the issue I am having:

Description of Issue

numpy version conflicts with what is required by tensorflow vs. mains stack.

  • What did you expect to happen?
  • What happened instead?
    | --> fetch -t SPY
    Traceback (most recent call last):
    File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 583, in _build_master
    ws.require(requires)
    File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
    File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (numpy 1.14.0 (/opt/venv/lib/python3.6/site-packages), Requirement.parse('numpy<2.0,>=1.16.0'), {'tensorflow'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/bin/fetch", line 6, in
from pkg_resources import load_entry_point
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 3251, in
@_call_aside
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 585, in _build_master
return cls._build_from_requirements(requires)
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/opt/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.14.0 (/opt/venv/lib/python3.6/site-packages), Requirement.parse('numpy<2.0,>=1.16.0'), {'tensorflow'})
Here is how you can reproduce this issue on your machine:

What steps have you taken to resolve this already?

Tried to upgrade numpy however, then main engine stops working since it require version lower (i.e. 1.14)
...

Anything else?

...

@vmajor
Copy link

vmajor commented Dec 24, 2019

I have the same issue.

Parser demands numpy<=1.14 and numpy<2.0,>=1.14.5 simultaneously.

This seems unresolvable. I have 1.18.0 which is the latest pip3 installable version on Ubuntu 18.04

@vmajor
Copy link

vmajor commented Dec 24, 2019

SOLVED:

It is a cludge, but it works to get me to the next error (KeyError: 'No metadata except PKG-INFO is available'):

  1. Uninstall numpy from both the venv and user that you are using to run sa (in my case root due to the instructions to run it from /opt/sa)

  2. install numpy 1.13.3 either with pip or pip3. In my case: pip3 install 'numpy==1.13.3'

  3. If you were blessed with multiple python installations just because, symlink from python3.6 to python3:

ln -s /usr/local/lib/python3.6/dist-packages/numpy  /usr/lib/python3/dist-packages/numpy
ln -s /usr/local/lib/python3.6/dist-packages/numpy-1.13.3.dist-info  /usr/lib/python3/dist-packages/numpy-1.13.3.dist-info

@atulhm
Copy link

atulhm commented May 30, 2020

Any progress on this issue? I am having the same problem

@jay-johnson
Copy link
Member

jay-johnson commented Sep 6, 2020

Sorry yea the requirements needed to be updated.

I got tests passing with yesterday's release (pypi's latest should be the same as well):

pip list | grep -E "stock-analysis-engine|numpy|pandas|tensorflow"
numpy                         1.19.1
pandas                        1.0.5
stock-analysis-engine         1.9.15      /opt/sa
tensorflow                    2.2.0
python --version
Python 3.8.0

Hopefully this new build resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants