Auquan / quant-quest-2

Quant Quest 2
3 stars 47 forks source link

not able to upgrade numpy #3

Closed ishikasingh closed 6 years ago

ishikasingh commented 6 years ago

on running python my_trading_params.py getting this error: File "my_trading_params.py", line 1, in from backtester.trading_system_parameters import TradingSystemParameters File "/Users/ishikasingh/Library/Python/2.7/lib/python/site-packages/backtester/init.py", line 1, in from backtester.dataSource import File "/Users/ishikasingh/Library/Python/2.7/lib/python/site-packages/backtester/dataSource/google_data_source.py", line 9, in import pandas as pd File "/Users/ishikasingh/Library/Python/2.7/lib/python/site-packages/pandas/init.py", line 23, in from pandas.compat.numpy import File "/Users/ishikasingh/Library/Python/2.7/lib/python/site-packages/pandas/compat/numpy/init.py", line 24, in 'this pandas version'.format(_np_version)) ImportError: this version of pandas is incompatible with numpy < 1.9.0 your numpy version is 1.8.0rc1. Please upgrade numpy to >= 1.9.0 to use this pandas version

The on running pip install --upgrade numpy getting this: Collecting numpy Using cached numpy-1.13.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Installing collected packages: numpy Found existing installation: numpy 1.8.0rc1 DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. Uninstalling numpy-1.8.0rc1: Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/init.py", line 267, in renames shutil.move(old, new) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat os.chflags(dst, st.st_flags) OSError: [Errno 1] Operation not permitted: '/var/folders/4f/yf6tpj4956718hzz4jfcv8zw0000gn/T/pip-c9LB0L-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

Kindly guide me with this.

Parth-Vader commented 6 years ago

@ishikasingh You could try using sudo with pip install - so your command becomes sudo pip install --upgrade numpy.

Otherwise - I'd recommend a full re-install inside a virtualenv.

ishikasingh commented 6 years ago

That is creating same permission problem again, but ignoring the previously installed numpy worked! The code is pip install numpy --user -U

TeamAuquan commented 6 years ago

Thanks Parth! Ishika I'm guessing you're using a Mac? Mac comes with preinstalled Python and doesn't let you make changes to it. I recommend the --user way v/s using sudo (you will have also have to make sure your local Python path is added to your sys path)