I have been trying to install zipline on OSX 10.11.2.
The pip install fails with this error:
$ pip install zipline
Collecting zipline
Using cached zipline-0.8.3-cp27-none-macosx_10_10_x86_64.whl
Collecting six==1.9.0 (from zipline)
Using cached six-1.9.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): python-dateutil==2.4.2 in /usr/local/lib/python2.7/site-packages (from zipline)
Collecting patsy==0.4.0 (from zipline)
Using cached patsy-0.4.0-py2.py3-none-any.whl
Collecting numexpr==2.4.3 (from zipline)
Using cached numexpr-2.4.3-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting cyordereddict==0.2.2 (from zipline)
Using cached cyordereddict-0.2.2.tar.gz
Collecting bcolz==0.10.0 (from zipline)
Using cached bcolz-0.10.0.tar.gz
Complete output from command python setup.py egg_info:
* Found Cython 0.23.4 package installed.
.. **ERROR:: You need numpy 1.7 or greater to run bcolz!**
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sj/py2gp2555d15c757mxtpwmn80000gn/T/pip-build-se3cq5/bcolz
I checked my numpy version, it's 1.10.2:
$ python
Python 2.7.11 (default, Dec 5 2015, 14:44:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.version.version
'1.10.2'
I tried installing bcolz separately (and it installed successfully) but that didn't solve the problem.
$ pip install -I zipline
didn't work either.
Any ideas about what I should do to install zipline?
EDIT: I ran pip install bcolz and the version installed was 0.12.1:
/usr/local/lib/python2.7/site-packages/bcolz$ cat version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.12.1'
One information you do not provide is the version of bcolz you tried to install separately. If it is not the 0.10.0, as zipline requirements file pins the version of bcolz (see here), if a newer version of bcolz has been installed (it will be the case if you just run pip install bcolz), the first thing the next install of zipline will do is to downgrade your bcolz installed version.
If you succeed in installing the version 0.10.0 of bcolz, the outputted error must be different and it would help to have it!
[EDIT]: so by running pip install bcolz==0.10.0, you're able to reproduce the same issue. It appears that due to a broken version comparison, bcolz, in its 0.10.0 version will be unable to work with version of numpy starting from 1.10. The only solution is then to downgrade numpy, and ping zipline developers so that they bump the used version of bcolz.
Answering my question in case anyone had the same issue. I ended up installing zipline using Anacaonda instead and it worked out alright. The package changes were:
The following NEW packages will be INSTALLED:
bcolz: 1.0.0-py27_0
click: 6.6-py27_0
contextlib2: 0.4.0-py27_0
cyordereddict: 0.2.2-py27_0
logbook: 0.12.5-py27_0
zipline: 0.9.0-np19py27_0
The following packages will be UPDATED:
bottleneck: 1.0.0-np110py27_0 --> 1.0.0-np19py27_0
numba: 0.24.0-np110py27_0 --> 0.24.0-np19py27_0
patsy: 0.4.0-np110py27_0 --> 0.4.0-np19py27_0
scipy: 0.17.0-np110py27_0 --> 0.17.0-np19py27_0
statsmodels: 0.6.1-np110py27_0 --> 0.6.1-np19py27_0
The following packages will be DOWNGRADED:
anaconda: 4.0.0-np110py27_0 --> custom-py27_0
astropy: 1.1.2-np110py27_0 --> 1.0.4-np19py27_0
h5py: 2.5.0-np110py27_4 --> 2.5.0-np19py27_3
matplotlib: 1.5.1-np110py27_0 --> 1.4.3-np19py27_3
numexpr: 2.5-np110py27_0 --> 2.4.6-np19py27_0
numpy: 1.10.4-py27_0 --> 1.9.3-py27_1
pandas: 0.18.0-np110py27_0 --> 0.16.2-np19py27_0
pytables: 3.2.2-np110py27_1 --> 3.2.2-np19py27_0
scikit-image: 0.12.3-np110py27_0 --> 0.11.3-np19py27_0
scikit-learn: 0.17.1-np110py27_0 --> 0.16.1-np19py27_0
Have been having exactly the same problem. Just to add to the answer. This is the terminal command that has worked for me : conda install -c quantopian zipline=1.0.2
Related
I installed pcse using this user guide: https://pcse.readthedocs.io/en/stable/user_guide.html#getting-started . I am unable to import the package in jupyter notebook while I have the environment activated in the miniconda terminal.
(base) C:\Users\merej>activate py3_pcse
(py3_pcse) C:\Users\merej>
I don't know if I'm required to add the virtual environment to jupyter notebook in order to use it so I added it using
pip install --user ipykernel
python -m ipykernel install --user --name=py3_pcse
The Kernel shows up in Jupyter notebook;However, Jupyter notebook is unable to connect to the notebook server. This is not a problem when I create a python3 notebook.
I saw that this may be a problem with Tornado so I uninstalled my current tornado, installed tornado 5.1.1, got an error message saying the tornando 5.1.1 would not work with my current version of jupyter notebook, uninstalled tornado 5.1.1, and reinstalled the updated version of tornado.
(py3_pcse) C:\Users\merej>pip uninstall tornado
Found existing installation: tornado 6.2
Uninstalling tornado-6.2:
Would remove:
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado-6.2.dist-info\*
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado\*
Proceed (Y/n)? y
Successfully uninstalled tornado-6.2
(py3_pcse) C:\Users\merej>pip install tornado==5.1.1
Collecting tornado==5.1.1
Downloading tornado-5.1.1.tar.gz (516 kB)
---------------------------------------- 516.8/516.8 kB 550.0 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: tornado
Building wheel for tornado (setup.py) ... done
Created wheel for tornado: filename=tornado-5.1.1-cp38-cp38-win_amd64.whl size=449834 sha256=160b8413fde8328df013e8729e86a92138e32c365dc6d9dc97a3e04b6cca17ea
Stored in directory: c:\users\merej\appdata\local\pip\cache\wheels\25\a1\e3\b0d37c6c451fc21f290cf026f6352382e6cbced32dc3f6a37a
Successfully built tornado
Installing collected packages: tornado
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
notebook 6.4.12 requires tornado>=6.1, but you have tornado 5.1.1 which is incompatible.
jupyterlab 3.4.4 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
jupyter-server 1.18.1 requires tornado>=6.1.0, but you have tornado 5.1.1 which is incompatible.
jupyter-client 7.3.5 requires tornado>=6.2, but you have tornado 5.1.1 which is incompatible.
ipykernel 6.15.2 requires tornado>=6.1, but you have tornado 5.1.1 which is incompatible.
Successfully installed tornado-5.1.1
(py3_pcse) C:\Users\merej>pip uninstall tornado
Found existing installation: tornado 5.1.1
Uninstalling tornado-5.1.1:
Would remove:
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado-5.1.1.dist-info\*
c:\users\merej\miniconda3\envs\py3_pcse\lib\site-packages\tornado\*
Proceed (Y/n)? y
Successfully uninstalled tornado-5.1.1
(py3_pcse) C:\Users\merej>pip install tornado
Collecting tornado
Using cached tornado-6.2-cp37-abi3-win_amd64.whl (425 kB)
Installing collected packages: tornado
Successfully installed tornado-6.2
This Jupyter notebook: https://github.com/ajwdewit/pcse_notebooks/blob/master/01%20Getting%20Started%20with%20PCSE.ipynb doesn't say anything about a kernel so perhaps I installed pcse into the wrong place. My installation passes all of the tests that are listed in the user guide using the miniconda terminal. I saw that this may be a problem with the version of pip that I used to install it since pcse uses python version 3.8; However, I believe that I am using the correct version of pip.
(py3_pcse) C:\Users\merej>pip --version
pip 22.2.2 from C:\Users\merej\miniconda3\envs\py3_pcse\lib\site-packages\pip (python 3.8)
(py3_pcse) C:\Users\merej>python --version
Python 3.8.13
Then I thought it may be a path problem so I made a python path in jupyter notebook using the path given by using python in the miniconda terminal but that also did not work.
(py3_pcse) C:\Users\merej>python
Python 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pcse
>>> pcse.__path__
['C:\\Users\\merej\\miniconda3\\envs\\py3_pcse\\lib\\site-packages\\pcse']
My level of understanding of all this is relatively low so feel free to explain anything you might find helpful.
Thanks!
tl;dr: You want to import pcse, but your jupyter kernel cannot yet do that.
You have correctly diagnosed this as being a virtual-environment issue.
And you're using conda, so the battle is half won already!
You chose to name your conda environment "py3_pcse", a perfectly good name.
That environment contains both PCSE and Jupyter dependencies.
Start by trying this in the base environment:
$ python -c 'import pcse'
Notice that, unsurprisingly, it fails.
Now $ conda activate py3_pcse, repeat the import, notice that it (silently) succeeds.
Here is the critically important piece.
While the environment is still active,
start the kernel with $ jupyter notebook
If the cPython interpreter could access pcse,
then the jupyter kernel will be able to, also.
Verify, by importing within a cell.
I am trying to restrict the range of acceptable versions of the ipykernel package when installing a project that has a pyproject.toml file requiring "setuptools>=45", and a setup.cfg file, which has the following as the install_requires option:
install_requires =
nexusformat >= 0.7.5
numpy
scipy
h5py >= 2.9
qtpy
qtconsole
ipython
ipykernel <= 6.8.0, >= 6.15.2
This triggers the following error message:
$ pip install -e .
Obtaining file:///Users/rosborn/Documents/Computing/Repositories/nexpy
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: matplotlib in /Users/rosborn/opt/miniconda3/envs/py38/lib/python3.8/site-packages (from NeXpy==0.14.6.dev6+g9996d70.d20220829) (3.6.0rc1)
ERROR: Could not find a version that satisfies the requirement ipykernel<=6.8.0,>=6.15.2 (from nexpy)
(from versions: 4.0.1, 4.0.2, 4.0.3, 4.1.0, 4.1.1, 4.2.0, 4.2.1, 4.2.2,
4.3.0, 4.3.1, 4.4.0, 4.4.1, 4.5.0, 4.5.1, 4.5.2, 4.6.0, 4.6.1, 4.7.0,
4.8.0, 4.8.1, 4.8.2, 4.9.0, 4.10.0, 4.10.1, 5.0.0b1, 5.0.0, 5.1.0,
5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.2.0, 5.2.1, 5.3.0, 5.3.1, 5.3.2, 5.3.3,
5.3.4, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.5.0, 5.5.3, 5.5.4, 5.5.5, 5.5.6,
6.0.0a0, 6.0.0a1, 6.0.0a2, 6.0.0a3, 6.0.0a4, 6.0.0a5, 6.0.0a6, 6.0.0b0,
6.0.0rc0, 6.0.0rc1, 6.0.0rc2, 6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.1.0, 6.2.0,
6.3.0, 6.3.1, 6.4.0, 6.4.1, 6.4.2, 6.5.0, 6.5.1, 6.6.0, 6.6.1, 6.7.0,
6.8.0, 6.9.0, 6.9.1, 6.9.2, 6.10.0, 6.11.0, 6.12.0, 6.12.1, 6.13.0,
6.13.1, 6.14.0, 6.15.0, 6.15.1, 6.15.2)
ERROR: No matching distribution found for ipykernel<=6.8.0,>=6.15.2
In other words, the error message lists the versions that it claims it cannot match. It even happens when either ipykernel v6.8.0 or ipykernel v6.15.2 are already installed.
I have seen similar StackOverflow issues (e.g., here) but I don't see the same setuptools error even with verbose output. Is there a problem with setting discontiguous ranges? Or another syntax error? Any suggestions welcome.
I am running setuptools v65.3.0 and pip 22.2.2 in Python 3.8.
Unfortunately, what you're trying to achieve doesn't work with using the range specifiers because the use of < <= > >= (in pip, setuptools, etc.) are done with logical AND-ing rather than logical OR-ing. Efforts to improve this aspect have stagnated.
So for your needs:
I need to exclude versions between 6.9 and 6.15.1,
You'd have to instead exclude the versions you don't want, using the version exclusion specifier !=.
This line would suffice and excludes all releases of ipykernel between 6.9.* and 6.15.1.
ipykernel != 6.9.*, != 6.10.*, != 6.11.*, != 6.12.*, != 6.13.*, != 6.14.*, != 6.15.0, != 6.15.1
And you'll see that this works with installation under your circumstances...
# Done with fresh Python env, installs latest
> pip install "ipykernel != 6.9.*, != 6.10.*, != 6.11.*, != 6.12.*, != 6.13.*, != 6.14.*, != 6.15.0, != 6.15.1"
Collecting ipykernel!=6.10.*,!=6.11.*,!=6.12.*,!=6.13.*,!=6.14.*,!=6.15.0,!=6.15.1,!=6.9.*
Collecting ipykernel-6.15.2-py3-none-any.whl
Downloading ipykernel-6.15.2-py3-none-any.whl (132 kB)
... etc ...
Installing collected packages: wcwidth, pure-eval, ptyprocess, pickleshare, executing, backcall, appnope, traitlets, tornado, six, pyzmq, pyparsing, pygments, psutil, prompt-toolkit, pexpect, parso, nest-asyncio, entrypoints, decorator, debugpy, python-dateutil, packaging, matplotlib-inline, jupyter-core, jedi, asttokens, stack-data, jupyter-client, ipython, ipykernel
Successfully installed appnope-0.1.3 asttokens-2.0.8 backcall-0.2.0 debugpy-1.6.3 decorator-5.1.1 entrypoints-0.4 executing-1.0.0 ipykernel-6.15.2 ipython-8.4.0 jedi-0.18.1 jupyter-client-7.3.5 jupyter-core-4.11.1 matplotlib-inline-0.1.6 nest-asyncio-1.5.5 packaging-21.3 parso-0.8.3 pexpect-4.8.0 pickleshare-0.7.5 prompt-toolkit-3.0.30 psutil-5.9.1 ptyprocess-0.7.0 pure-eval-0.2.2 pygments-2.13.0 pyparsing-3.0.9 python-dateutil-2.8.2 pyzmq-23.2.1 six-1.16.0 stack-data-0.5.0 tornado-6.2 traitlets-5.3.0 wcwidth-0.2.5
And try it with having an older ipykernel installed
# Let's try with installing an older ipykernel and then trying our new specifiers
> pip install ipykernel==6.7.0
Collecting ipykernel==6.7.0
# stuff
Successfully installed appnope-0.1.3 asttokens-2.0.8 backcall-0.2.0 debugpy-1.6.3 decorator-5.1.1 entrypoints-0.4 executing-1.0.0 ipykernel-6.7.0
> pip install "ipykernel != 6.9.*, != 6.10.*, != 6.11.*, != 6.12.*, != 6.13.*, != 6.14.*, != 6.15.0, != 6.15.1"
Requirement already satisfied: ipykernel!=6.10.*,!=6.11.*,!=6.12.*,!=6.13.*,!=6.14.*,!=6.15.0,!=6.15.1,!=6.9.*
in ./.venv/lib/python3.10/site-packages (6.7.0)
C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install matplotlib
Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0a
a09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.
whl
C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install --no-cache-dir matplotlib
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0aa
09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.w
hl (8.9MB)
100% |████████████████████████████████| 8.9MB 12.8MB/s
C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install matplotlib==1.5.1
Collecting matplotlib==1.5.1
Downloading https://files.pythonhosted.org/packages/8f/f4/c0c7e81f64d5f4d36e52
e393af687f28882c53dcd924419d684dc9859f40/matplotlib-1.5.1.tar.gz (54.0MB)
100% |████████████████████████████████| 54.0MB 18kB/s
I have tried the above 3 versions to install matplotlib package in python 3.6 but after complete processing, the exe file is not seen in the folder. It does not display any error so I cannot understand where the problem lies.
import matplotlib
raises error
Module Not Found Error
Open cmd as administrator and type : pip3 install matplotlib
At a guess I would say you're not installing to the correct library that is being used by the python interpreter.
Do you have Anaconda installed?
If so you will need to install packages using conda install to install packages.
Can you please advise me how to get Python3 with modules running at my Synology (DS214play, with DSM 6.0.1-7393 Update 1)?
What I want: run Tweepy and other modules in Python3 on my Synology.
Where I am stuck:
how to get PIP3 to install Tweepy, if I try I get: Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
Apparently I have a Python 2.7 installed but I was not aware...
root#DiskStation:/volume1/#appstore/python3/include# ls
get-pip.py python3.4m
root#DiskStation:/volume1/#appstore/python3/include# python3 get-pip.py
-ash: python3: command not found
root#DiskStation:/volume1/#appstore/python3/include# python get-pip.py
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
So to get PIP3 to work I need to understand where Python2.7 is installed and maybe even how to remove it (if this is necessary).
And it would be good to know which Python3 package would be best to use (default from Synology DSM package manager or the SynoCommunity Python3 pacakge)
Because I can see Python3 in the DSM package manager and in the related folders when connected with SSH (using PuTTY) to my Synology.
But I do not see any package for Python2.7 (which I believe must be there) and I cannot find any Python 2.7 folders when connected with SSH even tough I have the hint that there must be a " /usr/lib/python2.7/site-packages " folder somewhere...
-> The default Python3 from Synology DSM package manager is in a py3k folder:
admin#DiskStation: /volume1/#appstore/py3k/usr/local/bin$
python3
-> the SynoCommunity Python3 package installs in a different place:
admin#DiskStation: /volume1/#appstore/python3$ ls
bin etc include install.log lib openssl.cnf share
admin#DiskStation: /volume1/#appstore/python3/bin$ ls
2to3 busybox bzfgrep bzmore delgroup fatattr infocmp lzmainfo pip3 python3.4 reset start-stop-daemon tset virtualenv-3.4 xz
2to3-3.4 bzcat bzgrep captoinfo deluser gpg-error infotocap mpicalc pip3.4 python3.4m shuf tabs unlink wheel xzcat
addgroup bzcmp bzip2 clear dumpsexp hmac256 lzcat nice pydoc3 pyvenv speexdec tic unlzma xmlcatalog xzdec
adduser bzdiff bzip2recover c_rehash easy_install idle3 lzma openssl pydoc3.4 pyvenv-3.4 speexenc toe unxz xmllint
bunzip2 bzegrep bzless curl easy_install-3.4 idle3.4 lzmadec pip python3 renice sqlite3 tput virtualenv xsltproc
admin#DiskStation:/volume1/#appstore/python3/bin$ python3
-sh: python3: command not found
What I have done:
I installed Python3 using the Synology DSM package manager and then connected with SSH (using PuTTY) to my Synology and set the PATH and used PIP to install Tweepy and other modules.
I believe it was with some commands like: (unfortunately mostly copy pasted without knowing exactly what it means in detail...)
root#DiskStation:~# curl -k https://bootstrap.pypa.io/get-pip.py | python
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1488k 100 1488k 0 0 1577k 0 --:--:-- --:--:-- --:--:-- 1577k
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Collecting setuptools
Downloading setuptools-23.1.0-py2.py3-none-any.whl (435kB)
100% |████████████████████████████████| 440kB 551kB/s
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-8.1.2 setuptools-23.1.0 wheel-0.29.0
I was able to run scripts based on this and quite happy. Until I got some (Unicode) errors and from the error log saw that it is a 2.7 version of Python that runs on my Synology. It seems these Unicode issues are solved in Python3 (which I have on my PC as well) so I would like to have Python3 on Synology as well.
And the 2.7 version is indeed installed, if I connect with SSH and type Python I get:
admin#DiskStation:~$ python
Python 2.7.11 (default, May 13 2016, 05:16:12)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
This is strange because I do not see any Python 2.7 package at Synology in the package manager so I must have installed 2.7 through some SSH command that I intended just for PIP.
I had the default Python3 package at Synology installed and if I type admin#DiskStation:~$ python3
I did get the python3 ready to work with.
Within the /volume1/#appstore/py3k/ I see all kinds of Python and PIP versions and the python3 works well. However without any modules and the PIP3 does not work ("command not found"), I tried it from all possible directories and in all kinds of formats as suggested on similar Q&As e.g. pip3.4 install tweepy, pip3 install tweepy, etc.
So now using the DSM package manager I have deinstalled Python3 and installed the SynoCommunity Python3 (as suggested on the Synology forum here) which shows a different directory structure. But seems even worse because now I see no references to Python 2.7 anymore (but still it runs so must be there) and even cannot get python3 started:
admin#DiskStation:~$ cd /volume1
admin#DiskStation:/volume1$ cd #appstore
admin#DiskStation:/volume1/#appstore$ cd python3
admin#DiskStation:/volume1/#appstore/python3$ ls
bin etc include install.log lib openssl.cnf share
admin#DiskStation:/volume1/#appstore/python3$ cd bin
admin#DiskStation:/volume1/#appstore/python3/bin$ ls
2to3 bzcmp bzless deluser idle3 lzmainfo pydoc3 renice tabs unxz xz
2to3-3.4 bzdiff bzmore dumpsexp idle3.4 mpicalc pydoc3.4 reset tic virtualenv xzcat
addgroup bzegrep captoinfo easy_install infocmp nice python3 shuf toe virtualenv-3.4 xzdec
adduser bzfgrep clear easy_install-3.4 infotocap openssl python3.4 speexdec tput wheel
bunzip2 bzgrep c_rehash fatattr lzcat pip python3.4m speexenc tset xmlcatalog
busybox bzip2 curl gpg-error lzma pip3 pyvenv sqlite3 unlink xmllint
bzcat bzip2recover delgroup hmac256 lzmadec pip3.4 pyvenv-3.4 start-stop-daemon unlzma xsltproc
admin#DiskStation:/volume1/#appstore/python3/bin$ python3
-sh: python3: command not found
admin#DiskStation:/volume1/#appstore/python3/bin$ python
Python 2.7.11 (default, May 13 2016, 05:16:12)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
So I reached the point to ask for some tips, hints and advice.
(1)install python2.7 and python3.5 from DSM packages
(2)ssh login & sudo -i
(3)run python and run python3, if both work go next.
(4)run pip -V should return pip 10.0.1, it is for python2.7
(5)run pip3 -V return "command not found", ..because the path is not right.
(6)try /volume1/#appstore/py3k/usr/local/bin/pip3 -V,
if sucess. go next. now you can install module for python3, it's different path depends on your system, command for example: /volume1/#appstore/py3k/usr/local/bin/pip3 install numpy should be work!
(7)for convenient, shorter command is good for use,so go next step:
sudo vi .profile, (or .bashrc for specific user login)
(8)add alias at the end:
alias pip3='/volume1/#appstore/py3k/usr/local/bin/pip3'
(9)source .profile or sudo reboot
(10)test pip3 -V, should work for python3.x
Ok, many thx for the replies, I solved it with:
Confirmed that Python 2.7.9 is installed by default in Synology DSM 5.2 (and not visible in package center).
I was able to add modules to Python3 by specifically evoking the pip module installation for Python3 using this command:(thx to this Q&A)
/volume1/#appstore/py3k/usr/local/lib/python3.5/site-packages/pip install tweepy
(installing the tweepy module in this case)
And FYI the full command overview:
admin#DiskStation:/volume1/#appstore/py3k/usr/local/lib/python3.5/site-packages$ sudo -i
Password:
root#DiskStation:~# curl -O https://bootstrap.pypa.io/get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1488k 100 1488k 0 0 1704k 0 --:--:-- --:--:-- --:--:-- 1703k
root#DiskStation:~# sudo python3 get-pip.py
Requirement already up-to-date: pip in /volume1/#appstore/py3k/usr/local/lib/python3.5/site-packages
root#DiskStation:~# pip install tweepy
Requirement already satisfied (use --upgrade to upgrade): tweepy in /usr/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.7.3 in /usr/lib/python2.7/site-packages (from tweepy)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4.3 in /usr/lib/python2.7/site-packages (from tweepy)
Requirement already satisfied (use --upgrade to upgrade): requests-oauthlib>=0.4.1 in /usr/lib/python2.7/site-packages (from tweepy)
Requirement already satisfied (use --upgrade to upgrade): oauthlib>=0.6.2 in /usr/lib/python2.7/site-packages (from requests-oauthlib>=0.4.1->tweepy)
root#DiskStation:~# python3 ^C
root#DiskStation:~# python3 /volume1/#appstore/py3k/usr/local/lib/python3.5/site-packages/pip install tweepy
Collecting tweepy
Using cached tweepy-3.5.0-py2.py3-none-any.whl
Collecting requests-oauthlib>=0.4.1 (from tweepy)
Using cached requests_oauthlib-0.6.1-py2.py3-none-any.whl
Collecting requests>=2.4.3 (from tweepy)
Using cached requests-2.10.0-py2.py3-none-any.whl
Collecting six>=1.7.3 (from tweepy)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting oauthlib>=0.6.2 (from requests-oauthlib>=0.4.1->tweepy)
Using cached oauthlib-1.1.2.tar.gz
Building wheels for collected packages: oauthlib
Running setup.py bdist_wheel for oauthlib ... done
Stored in directory: /root/.cache/pip/wheels/e6/be/43/e4a2ca8cb9c78fbd9b5b14b96cb7a5cc43f36bc11af5dfac5b
Successfully built oauthlib
Installing collected packages: requests, oauthlib, requests-oauthlib, six, tweepy
Successfully installed oauthlib-1.1.2 requests-2.10.0 requests-oauthlib-0.6.1 six-1.10.0 tweepy-3.5.0
(And I uninstalled the SynoCommunity Python3 package again and now use the DSM package center Python3 version)
I'm not sure you can remove Python 2 altogether, but you can install Python 3 and evoke it specifically instead of Python 2.
First, make sure Python 3 is Installed:
Log into your Synology via the web administration and in the 'Package Center' make sure 'Python 3' is installed. (You will find it under 'Developer Tools' within the 'Package Center')
Next, specifically evoke Python 3 by simply calling python3
You could also try using the locate command on your Synology to find the exact location of Python 2. To do this enter the following on your Synology:
ipkg update
ipkg install mlocate
And here is a tutorial on how to use the command: http://www.thegeekstuff.com/2012/03/locate-command-examples/
Good luck!
Also,
If you don't have luck on Stack Overflow I'd run over to the Synology Forums for help as well: https://forum.synology.com
I tried to install gdal (pip install gdal)in virtualenvwrapper environment but I got this error :
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for gdal
Failed to build gdal
I tried also "pip install --no-install GDAL" but there is nooption --no-install
what should I do !?
Yes, installing GDAL in a venv is a doozy. Conveniently, I just wrote up the documentation on how to do so for my advisor's lab! While I am not savvy enough to pinpoint the exact cause of your error, I can give you a bunch of things to try to fix it.
First, ensure you have gdal installed on the host (i.e. not in a venv). I just run the following:
sudo apt-get install libgdal1i libgdal1-dev libgdal-dev
Now run gdal-config --version to get the version that apt-get provided you with. For example I get 1.11.3
Now, the easiest way in my experience to get the python bindings in a venv is using pygdal. The trick is to get the right version! To do so, activate your virtual environment and run
pip install pygdal==1.11.3
but replace the version with whatever you got from gdal-config --version. Note: you may get an error that says
Could not find a version that satisfies the requirement pygdal==1.11.3 (from versions: 1.8.1.0, 1.8.1.1, 1.8.1.2, 1.8.1.3, 1.9.2.0, 1.9.2.1, 1.9.2.3, 1.10.0.0, 1.10.0.1, 1.10.0.3, 1.10.1.0, 1.10.1.1, 1.10.1.3, 1.11.0.0, 1.11.0.1, 1.11.0.3, 1.11.1.0, 1.11.1.1, 1.11.1.3, 1.11.2.1, 1.11.2.3, 1.11.3.3, 1.11.4.3, 2.1.0.3) No matching distribution found for pygdal==1.11.3
If that happens, run the pip install again but with the highest version that still matches. e.g. in this case you would run pip install pygdal==1.11.3.3
Once pygdal has been successfully installed, you should be able to call
>>> from osgeo import gdal
Please let me know if anything fails and I'll do what I can to adjust my instructions. Also, if you need help with Proj.4, GEOS, or Cartopy, I have some experience there too.
use pygdal
pd#asghar:~$sudo apt-get install python3-gdal
pd#asghar:~$ virtualenv -p python3 test
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pd/test/bin/python3
Also creating executable in /home/pd/test/bin/python
Installing setuptools, pip, wheel...done.
pd#asghar:~$ gdal-config --version
2.1.3
pd#asghar:~$ test/bin/pip install pygdal==2.1.3
Collecting pygdal==2.1.3
Could not find a version that satisfies the requirement pygdal==2.1.3 (from versions: 1.8.1.0, 1.8.1.1, 1.8.1.2, 1.8.1.3, 1.9.2.0, 1.9.2.1, 1.9.2.3, 1.10.0.0, 1.10.0.1, 1.10.0.3, 1.10.1.0, 1.10.1.1, 1.10.1.3, 1.11.0.0, 1.11.0.1, 1.11.0.3, 1.11.1.0, 1.11.1.1, 1.11.1.3, 1.11.2.1, 1.11.2.3, 1.11.3.3, 1.11.4.3, 1.11.5.3, 2.0.0.3, 2.0.1.3, 2.0.2.3, 2.0.3.3, 2.1.0.3, 2.1.1.3, 2.1.2.3, 2.1.3.3, 2.2.0.3)
No matching distribution found for pygdal==2.1.3
pd#asghar:~$ test/bin/pip install pygdal==2.1.3.3
Collecting pygdal==2.1.3.3
Collecting numpy>=1.0.0 (from pygdal==2.1.3.3)
Using cached numpy-1.13.1-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: numpy, pygdal
Successfully installed numpy-1.13.1 pygdal-2.1.3.3
pd#asghar:~$ source test/bin/activate
(test) pd#asghar:~$ python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from osgeo import gdal
>>>
On MacOS, first do brew install:
brew install gdal
Then do pip install:
pip install gdal