Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure how to get this running. #23

Closed
deathclonic opened this issue Apr 15, 2021 · 7 comments
Closed

Not sure how to get this running. #23

deathclonic opened this issue Apr 15, 2021 · 7 comments

Comments

@deathclonic
Copy link

I looked through the instructions and none of it made sense to me. ¯_(ツ)_/¯

@Seon82
Copy link

Seon82 commented Apr 16, 2021

Have you ever used python, or is it new to you?

@deathclonic
Copy link
Author

I've never used python.

@Seon82
Copy link

Seon82 commented Apr 16, 2021

Alright!
You'll want to:

  • install python (make sure you tick the Add to PATH box)
  • open a terminal, and run pip install git+https://github.com/sedthh/pyxelate (replace pip by pip3 if you're running mac or linux). This will install this project and all its dependencies as a package that can be used in your code.
  • save the first example code from the README (right under Usage) in a file with a .py extension, replacing "examples/blazkowicz.jpg" by your file name. There's also a few other settings you should modify, such as downsample_by (by what factor you want to rescale the image) or palette (the numer of colors to use). You'll want to make sure the file is in the same folder as your image to avoid problems.
  • (Optional) If you want to experiment with some of the other options shown in the README, you can modify the line pyx = Pyx(factor=downsample_by, palette=palette). For example, if you want to try out the bayer dithering style, you can write pyx = Pyx(factor=downsample_by, palette=palette, dither="bayer"). And add as many parameters as you'd like, separated by commas :)
  • Run your python file - it might work out-of-the-box by double-clicking it. Otherwise open a terminal, navigate to your folder, and run python yourfilename.py (or python3 if you're running mac or linux). The pyxelated image will appear in the folder!

@deathclonic
Copy link
Author

I tried installing scikit image from this site https://scikit-image.org/docs/stable/install.html#install-via-pip but I keep getting these errors.

ERROR: Could not find a version that satisfies the requirement scikit-image>=0.18.1 (from pyxelate)
ERROR: No matching distribution found for scikit-image>=0.18.1

@Seon82
Copy link

Seon82 commented Apr 17, 2021

You shouldn't have to install it manually, it will get installed automatically when you run pip install git+https://github.com/sedthh/pyxelate. Do you run into the same problem with that command?

@deathclonic
Copy link
Author

Yeah I just keep getting that error.

@limsammy
Copy link

limsammy commented Sep 30, 2021

EDIT: proper Issue with much more info here: #25

Hey, I'm having an odd issue. When I clone the repository and run the example notebook everything runs perfectly.

However when I try to copy the example code and run it standalone (or simply edit the notebook with an image of my own) I get a segmentation fault.

Any idea why this is happening? The segfault occurs with the example blazkowicz.jpg image too, even though it runs fine in the notebook on first run.

I am using Python 3.9.7 by the way. I've also tried installing all deps in both a virtual env as well as my global. On a macbook, do I need more resources?

EDIT: attempting to run the notebook again (specifically the first example with blazkowicz) causes the jupyter kernel to die.

Here is my stacktrace:

ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x112d2a0d0>(<Future finis...C: 1\r\n\r\n'>)
handle: <Handle <TaskWakeupMethWrapper object at 0x112d2a0d0>(<Future finis...C: 1\r\n\r\n'>)>
Traceback (most recent call last):
  File "/Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-4' coro=<HTTP1ServerConnection._server_request_loop() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/http1connection.py:823> wait_for=<Future finished result=b'GET /api/co...PC: 1\r\n\r\n'> cb=[IOLoop.add_future.<locals>.<lambda>() at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/ioloop.py:688]> while another task <Task pending name='Task-2' coro=<KernelManager._async_start_kernel() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/jupyter_client/manager.py:336>> is being executed.
ERROR:asyncio:Exception in callback <TaskWakeupMethWrapper object at 0x112f06ca0>(<Future finis...db1"\r\n\r\n'>)
handle: <Handle <TaskWakeupMethWrapper object at 0x112f06ca0>(<Future finis...db1"\r\n\r\n'>)>
Traceback (most recent call last):
  File "/Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-5' coro=<HTTP1ServerConnection._server_request_loop() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/http1connection.py:823> wait_for=<Future finished result=b'GET /kernel...9db1"\r\n\r\n'> cb=[IOLoop.add_future.<locals>.<lambda>() at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/tornado/ioloop.py:688]> while another task <Task pending name='Task-2' coro=<KernelManager._async_start_kernel() running at /Users/red_rocket/.pyenv/versions/3.9.7/lib/python3.9/site-packages/jupyter_client/manager.py:336>> is being executed.

EDIT: going to move this to a proper issue

@sedthh sedthh closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants