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

Python 3 #1

Closed
odyslam opened this issue Dec 15, 2015 · 6 comments
Closed

Python 3 #1

odyslam opened this issue Dec 15, 2015 · 6 comments

Comments

@odyslam
Copy link

odyslam commented Dec 15, 2015

I am installing in on my pi and it seems to install only in my library for pyton 2.7, how can i force it to use it in python 3 (unfortunately i have to use python 3)

Thank you

@remcohaszing
Copy link
Owner

First of all, it's cool to hear people are still using this project. :)

On itself this project should support Python 3. If Python 3 support is the real issue, I think I should be able to solve this.

I'm going to need a bit more detail to answer this though.

  1. What is the operating system? Raspbian (or anything else Debian based)?
  2. How did you try to install this?

@odyslam
Copy link
Author

odyslam commented Dec 16, 2015

Hey,
Thank you for your rapid response! To be honest it’s exactly what i was looking for . I am using it on raspbian (rasp pi 2 ). I installed it by git clone-then setup build, then setup install.
It installs only as a python 2.7 library (according to the terminal) and during the installation it doesn’t mention python 3 , something that is proven as python 3 can’t import it. (I hate using python3 but since i am using webiopi i am forces to write my scripts with python3)
Thank you for your time :)

On 16 Dec 2015, at 9:54 PM, Remco Haszing notifications@github.com wrote:

First of all, it's cool to hear people are still using this project. :)

On itself this project should support Python 3. If Python 3 support is the real issue, I think I should be able to solve this.

I'm going to need a bit more detail to answer this though.

What is the operating system? Raspbian (or anything else Debian based)?
How did you try to install this?

Reply to this email directly or view it on GitHub #1 (comment).

@remcohaszing
Copy link
Owner

You did not mention virtualenv, so I assume you are trying to install this package system-wide as root. I do _not_ recommend this, but it should still work.

I guess this sums up the commands you ran:

$ git clone https://github.com/remcohaszing/pywakeonlan.git
$ cd pywakeonlan
$ ./setup.py build  # This is redundant.
$ ./setup.py install

Note that the shebang in setup.py refers to /usr/bin/env python. If I'm correct this refers to Python 2.7 on your system.

$ /usr/bin/env python --version

This is why it gets installed as a Python 2.7 package.

The closest to your current solution is to explicitly call setup.py with the preferred Python version.

$ python3 setup.py install

However, I recommend installing it using pip

$ pip3 install wakeonlan

I'll make some patches to renew and document the installation process as soon as I have time. ;)

@odyslam
Copy link
Author

odyslam commented Dec 17, 2015

Hey!,
After much search i managed to use my webiopi with python2.7 as i found out that 70% of my modules wouldn’t cooperate with python3 , but really thanks for your swift reply (and thanks to you i found out about pip3 haha)

One last question though, as i am fairly new, what is virtualenv? I haven’t stumbled upon that in any of my projects so i have now idea what you are talking about(although i can imagine). Thank you again for your time :)

On 17 Dec 2015, at 1:02 AM, Remco Haszing notifications@github.com wrote:

You did not mention virtualenv, so I assume you are trying to install this package system-wide as root. I do not recommend this, but it should still work.

I guess this sums up the commands you ran:

$ git clone https://github.com/remcohaszing/pywakeonlan.git
$ cd pywakeonlan
$ ./setup.py build # This is redundant.
$ ./setup.py install
Note that the shebang in setup.py refers to /usr/bin/env python. If I'm correct this refers to Python 2.7 on your system.

$ /usr/bin/env python --version
This is why it gets installed as a Python 2.7 package.

The closest to your current solution is to explicitly call setup.py with the preferred Python version.

$ python3 setup.py install
However, I recommend installing it using pip

$ pip3 install wakeonlan
I'll make some patches to renew and document the installation process as soon as I have time. ;)


Reply to this email directly or view it on GitHub #1 (comment).

@dpatterson-aio
Copy link

python3 has a fancy bytes.fromhex function, so the packet creation can be something like bytes.fromhex('FF'*6 + mac*16)

@remcohaszing
Copy link
Owner

This was a question, not an issue. I'm closing this.

@dpatterson-aio that would break Python 2 compatibility.

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

3 participants