Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

CircuitPython no such option: --no-compile #9

Closed
jwillikers opened this issue Jul 11, 2021 · 5 comments
Closed

CircuitPython no such option: --no-compile #9

jwillikers opened this issue Jul 11, 2021 · 5 comments

Comments

@jwillikers
Copy link

Thanks for working on this!

I'm on Fedora Silverblue 34, using Python version 3.9.6 and pip 21.0.1.
When I attempt to install CircuitPython libraries, I receive the following error message.

$ minipip install --port /dev/ttyACM1 --target /lib adafruit-circuitpython-framebuf
Processing 'adafruit-circuitpython-framebuf'
Querying package metadata from https://micropython.org/pi/adafruit-circuitpython-framebuf/json
Could not find 'adafruit-circuitpython-framebuf' from https://micropython.org/pi
Querying package metadata from https://pypi.org/pypi/adafruit-circuitpython-framebuf/json
Inspecting version 1.4.7
Installing with pip: ['adafruit-circuitpython-framebuf']

Usage:   
  /usr/bin/python3 -m pip <command> [options]

no such option: --no-compile
aivarannamaa added a commit that referenced this issue Jul 11, 2021
@aivarannamaa
Copy link
Owner

Thank you for the report!

It was stupid of me to add a small tweak without testing it. Fixed now and uploaded as version 0.1b4. Please pip install minipip==0.1b4 and try again!

@jwillikers
Copy link
Author

Well, that does get a bit farther but I'm still hitting an error.

$ minipip install --port /dev/ttyACM1 --target /lib adafruit-circuitpython-framebuf
Processing 'adafruit-circuitpython-framebuf'
Querying package metadata from https://micropython.org/pi/adafruit-circuitpython-framebuf/json
Could not find 'adafruit-circuitpython-framebuf' from https://micropython.org/pi
Querying package metadata from https://pypi.org/pypi/adafruit-circuitpython-framebuf/json
Inspecting version 1.4.7
Installing with pip: ['adafruit-circuitpython-framebuf']
Collecting adafruit-circuitpython-framebuf
  Using cached adafruit_circuitpython_framebuf-1.4.7-py3-none-any.whl
Collecting Adafruit-Blinka
  Using cached Adafruit_Blinka-6.10.3-py3-none-any.whl
Collecting pyftdi>=0.40.0
  Using cached pyftdi-0.53.2-py3-none-any.whl (141 kB)
Collecting Adafruit-PlatformDetect>=3.13.0
  Using cached Adafruit_PlatformDetect-3.14.2-py3-none-any.whl
Collecting Adafruit-PureIO>=1.1.7
  Using cached Adafruit_PureIO-1.1.9-py3-none-any.whl
Collecting pyusb<1.2.0,>=1.0.0
  Using cached pyusb-1.1.0-py3-none-any.whl
Collecting pyserial>=3.0
  Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Installing collected packages: pyusb, pyserial, pyftdi, Adafruit-PureIO, Adafruit-PlatformDetect, Adafruit-Blinka, adafruit-circuitpython-framebuf
Successfully installed Adafruit-Blinka-6.10.3 Adafruit-PlatformDetect-3.14.2 Adafruit-PureIO-1.1.9 adafruit-circuitpython-framebuf-1.4.7 pyftdi-0.53.2 pyserial-3.5 pyusb-1.1.0
Using buffer-size of 32
Connecting to /dev/ttyACM1 (buffer-size 32)...
Trying to connect to REPL . connected
Retrieving sysname ... b'\r\nAuto-reload is on. Simply save files over USB to run them or enter REPL to disable.\r\ncode.py output:\r\n'
Traceback (most recent call last):
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1383, in connect
    ip_address = socket.gethostbyname(port)
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/home/jordan/.local/bin/rshell", line 33, in <module>
    sys.exit(load_entry_point('rshell==0.0.30', 'console_scripts', 'rshell')())
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/command_line.py", line 4, in main
    rshell.main.main()
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 3084, in main
    real_main()
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 3046, in real_main
    connect(args.port, baud=args.baud, wait=args.wait, user=args.user, password=args.password)
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1389, in connect
    connect_serial(port, baud=baud, wait=wait)
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1413, in connect_serial
    dev = DeviceSerial(port, baud, wait)
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1744, in __init__
    Device.__init__(self, pyb)
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1497, in __init__
    self.sysname = self.remote_eval(sysname)
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1632, in remote_eval
    return eval(self.remote(func, *args, **kwargs))
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/main.py", line 1610, in remote
    self.pyb.enter_raw_repl()
  File "/var/home/jordan/.local/lib/python3.9/site-packages/rshell/pyboard.py", line 209, in enter_raw_repl
    raise PyboardError('could not enter raw repl')
rshell.pyboard.PyboardError: could not enter raw repl

@aivarannamaa
Copy link
Owner

It looks like rshell could connect to your device, but could not get the REPL. I don't understand, why it later wants to treat your port as host address, though.

Which device are you using? From Simply save files over USB to run them or enter REPL to disable I infer it's running CircuitPython. In this case it should mount its filesystem on your PC (Linux?) and you should be able to omit --port and give the path to the mounted lib directory as --target.

There's something more -- if you're installing Adafruit libraries from PyPI, they came with set of dependencies which are not relevant in CircuitPython (Blinka, platform-detect and maybe something more). I'll try to make minipip smarter so that it omits these when installing for CircuitPython device.

@jwillikers
Copy link
Author

I'm using CircuitPython 7.0.0 alpha 4 on a Feather RP2040. It automatically mounts the drive's filesystem to /run/media/$USER/CIRCUITPY. I was just following the example provided in the README, and I wasn't sure why it needed the --port option. Thanks for the help, it makes sense not to include that. It would definitely help if it omits those host-specific libraries. Thanks!

@aivarannamaa
Copy link
Owner

Created separate issue for skipping Blinka: #10

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

No branches or pull requests

2 participants