Troubles with numpy - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Troubles with numpy (/thread-10828.html) |
Troubles with numpy - sylas - Jun-08-2018 Hi all ! I installed twice numpy. Last time with "pip install --upgrade numpy". It installed numpy-1.14.4. But when I use it, it says it cannot handle multiarrays. My question: is it preferable to 1. pip --upgrade numpy 2. pip install numpy ??? RE: Troubles with numpy - sylas - Jun-08-2018
RE: Troubles with numpy - snippsat - Jun-08-2018 (Jun-08-2018, 09:21 AM)sylas Wrote: C:\Users\Sylvain\numpy\numpy folder should not be there at all. How you mange to get it there i don't know. If check pip what dos it point to? C:\>pip -V pip 10.0.1 from c:\python36\lib\site-packages\pip (python 3.6)Then pip install numpy will install to 3.6 at that location.>>> import numpy >>> >>> numpy.__file__ 'C:\\Python36\\lib\\site-packages\\numpy\\__init__.py'Even if i make a virtual environment and install numpy is always in site-packages\numpy # Make C:\bar λ python -m venv my_env # cd in C:\bar λ cd my_env # Activate C:\bar\my_env λ C:\bar\my_env\Scripts\Activate (my_env) C:\bar\my_env # Check pip λ pip -V pip 9.0.1 from c:\bar\my_env\lib\site-packages (python 3.6) # Install (my_env) C:\bar\my_env λ pip install numpy Collecting numpy Downloading https://files.pythonhosted.org/packages/6c/49/2bcf9d0484b33a6d7c5312121344a190d4a3d5f7826fcb3480cb62109073/numpy-1.14.4-cp36-none-win32.whl (9.8MB) 100% |████████████████████████████████| 9.8MB 125kB/s Installing collected packages: numpy Successfully installed numpy-1.14.4 # Test (my_env) C:\bar\my_env λ python Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> >>> numpy.__file__ 'C:\\bar\\my_env\\lib\\site-packages\\numpy\\__init__.py' RE: Troubles with numpy - sylas - Jun-08-2018 I had copied numpy in "Users\Sylvain" because i had this error message. Of course, following your indication I deleted the numpy in "Users\Sylvain"
RE: Troubles with numpy - snippsat - Jun-08-2018 Now it's okay,you need of course to install it. # Check C:\Users\Tom λ pip -V pip 10.0.1 from c:\python36\lib\site-packages\pip (python 3.6) # Install C:\Users\Tom λ pip install numpy --upgrade Collecting numpy Using cached https://files.pythonhosted.org/packages/6c/49/2bcf9d0484b33a6d7c5312121344a190d4a3d5f7826fcb3480cb62109073/numpy-1.14.4-cp36-none-win32.whl mypy 0.560 has requirement psutil<5.5.0,>=5.4.0, but you'll have psutil 5.3.1 which is incompatible. Installing collected packages: numpy Successfully installed numpy-1.14.4 # Test that it work C:\Users\Tom λ ptpython >>> import numpy >>> numpy.__version__ '1.14.4' RE: Troubles with numpy - sylas - Jun-08-2018 There is a long time it is installed(successfully) at C:\python35\\lib\site-packages. And its version is: 1.14.4 Strange enough python cannot find it ! At last found that there is no trouble if I use "python" instead of "ptpython". Look at this: λ python ActivePython 3.5.4.3504 (ActiveState Software Inc.) based on Python 3.5.4 (default, Dec 15 2017, 14:24:56) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> numpy.__file__ 'C:\\Python35\\lib\\site-packages\\numpy\\__init__.py' >>> RE: Troubles with numpy - snippsat - Jun-08-2018 For 3.6 as you should use. Python 3.6 and pip installation under Windows The it will work as i posted,i do have 2.7,3.4,3.5 ect. 3.6 is the main version set in Windows Path(as tutorial show how to under install). Then it look like this from C:\. So anywhere from cmd/cmder, pip and python always point to 3.6λ python -c "import sys; print(sys.executable)" C:\python36\python.exe C:\ λ pip -V pip 10.0.1 from c:\python36\lib\site-packages\pip (python 3.6)Using other version can use py.exe ,that 3.6 install in Windows folder.C:\ λ py -2.7 -V Python 2.7.9 C:\ λ py -3.5 -V Python 3.5.2 RE: Troubles with numpy - sylas - Jun-08-2018 Another remark: ptpython version is: 3.6.4 RE: Troubles with numpy - snippsat - Jun-08-2018 (Jun-08-2018, 05:40 PM)sylas Wrote: Another remark: ptpython version is: 3.6.4It dos not matter make sure installasjon is okay first,follow link on how to install 3.6. Restart Pc. Then as posted test that python and pip point to 3.6.Then in future will all install point to 3.6. pip install ptpython pip install numpy --upgrade ect... will install to 3.6 RE: Troubles with numpy - sylas - Jun-09-2018 I am sure python 3.6 is installed. Why pip speaks of python 3.5 instead of 3.6 ?? C:\ λ pip -V pip 10.0.1 from c:\python35\lib\site-packages\pip (python 3.5) C:\ λ py -3.6 -V Python 3.6.4 C:\ λ pip -V pip 10.0.1 from c:\python35\lib\site-packages\pip (python 3.5)You see I have 3.6.4, but with pip -V, it comes back to 3.5. What shall I do for having 3.6 ?? |