Python Forum
Cannot use pypy on Python3 code
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot use pypy on Python3 code
#1
I am trying pypy on some code that I believe is Python3 code.

When I tried it on some code that worked under Python3 i got an error.
The same error over and over. It is about NumpPY not being installed.

It i for python3. What must I to install numpy for pypy compiling Python3 code?

Any help appreciated. Thanks in advance.

Respectfully,

ErnestTBass

here is the error:

Traceback (most recent call last):
File "ann.py", line 1, in <module>
import numpy as np
Reply
#2
what is the Name of installed package (one that uses Numpy)?
Reply
#3
(May-15-2018, 02:23 PM)ErnestTBass Wrote: It i for python3. What must I to install numpy for pypy compiling Python3 code?
Get pip for PyPy
Should I install numpy or numpypy?
pypy3 -m pip install numpy
Binary wheels for PyPy with numpy
Reply
#4
I installed numpy for Ptyhon2 and Python3.

Here is the system response.

james@james-VirtualBox:~/Desktop$ pypy basic-multilayer-ann.py
Traceback (most recent call last):
File "basic-multilayer-ann.py", line 1, in <module>
import numpy as np
ImportError: No module named numpy
james@james-VirtualBox:~/Desktop$ pip install numpy
Requirement already satisfied: numpy in /home/james/.local/lib/python2.7/site-packages (1.14.3)
james@james-VirtualBox:~/Desktop$ pip3 install numpy
Requirement already satisfied: numpy in /home/james/.local/lib/python3.5/site-packages (1.14.3)
james@james-VirtualBox:~/Desktop$ pypy ann.py

What is causing this? Everything tTat is installed should be.


Respectfully,

ErnestTBass
Reply
#5
(May-15-2018, 04:24 PM)ErnestTBass Wrote: I installed numpy for Ptyhon2 and Python3.
That make no difference,you most install to PyPy.
PyPy is an alternative implementation,so it has nothing to with OS installation of Python.

Read the my post one more time,you most get pip for PyPy then install to with:
pypy -m pip install numpy
Example with an older version on PyPy that i have.
C:\pypy5.4
λ pypy -m ensurepip
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-6.1.1 setuptools-15.2

# See that pip point PyPy.
C:\pypy5.4
λ pypy -m pip -V
pip 6.1.1 from C:\pypy5.4\site-packages (python 2.7)

# Install Requests
C:\pypy5.4
λ pypy -m pip install requests
You are using pip version 6.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting requests
  Downloading https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |################################| 90kB 1.8MB/s
.........
Successfully installed certifi-2018.4.16 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22

# Test that Requests work in PyPy
C:\pypy5.4
λ pypy
Python 2.7.10 (c95650101a99, Sep 06 2016, 15:44:55)
[PyPy 5.4.1 with MSC v.1500 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> import requests
>>>> requests.__version__
'2.18.4'
>>>> exit()
All i have done over has nothing to do with my main OS version which is Python 3.6.
Reply
#6
Here is what I got when I installed :

pypy -m install numpy
/usr/bin/pypy: No module named install

So I still must be doing something wrong.

respectfully,


ErnestTBasss
Reply
#7
You are missing pip in command.
pypy -m pip install numpy
Reply
#8
Here is the result when I issue the command.

james@james-VirtualBox:~/Desktop$ pypy -m pip install numpy
/usr/bin/pypy: No module named pip
james@james-VirtualBox:~/Desktop$ pypy -m pip install numpy

It says no module named pip. What do i do t fix this?


Respectfully,

ErnstTBass
Reply
#9
Quote:It says no module named pip. What do i do t fix this?
Read snippsat's post. You need to install pip for PiPy not any other pip!
Reply
#10
Okay, is it install PIP for pypy pr PIP for pypi. What is the syntax? I cannot find it on the web?

R.

ErnestTBass
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linear Regression Python3 code giving weird solutions deepsen 0 1,445 Nov-01-2019, 12:06 PM
Last Post: deepsen
  Pypy installation in Windows 10 Frankie 2 10,668 Jun-13-2018, 04:05 AM
Last Post: Frankie

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020