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

python2 and platformio not recognized (Arch Linux) #64

Closed
Jakeler opened this issue Sep 15, 2016 · 15 comments
Closed

python2 and platformio not recognized (Arch Linux) #64

Jakeler opened this issue Sep 15, 2016 · 15 comments

Comments

@Jakeler
Copy link

Jakeler commented Sep 15, 2016

"Deviot needs python2.7" popups all the time, although i have python2 + python2.7 installed and in the PATH... but Deviot searches only for python, which is linked to python3.5 on Arch. It works when i change this symlink to 2.7 (no permanent solution, breaks a lot other stuff).

After that Deviot says "PlatformIO is not installed" and downloads everything. Even though i also had platformio and pio already installed in /usr/bin.

@gepd
Copy link
Owner

gepd commented Sep 15, 2016

Hi @Jakeler,
to understand, normally to run pyton 2.7 you use python2 command is that right? I'll check how to easily change that, it shouldn't be a big problem

Deviot checks if PlatformIO is installed in the machine before to procced with the new install, I'll check again the default paths to see if that is the problem

@Jakeler
Copy link
Author

Jakeler commented Sep 15, 2016

Yes, that is right and #!/usr/bin/env python2 in scripts.

@gepd
Copy link
Owner

gepd commented Sep 15, 2016

Let's make some test

  • First download the develop branch and replace the files in Packages/Deviot
  • Locate the file in Deviot/libs/Install.py and change the line 49 to:
self.python = os.path.join(self.env_bin_dir, 'python2')
  • Locate the file in Deviot/libs/Commands.py and change the line 33 to:
self.python = os.path.join(env_bin_dir, 'python2')

After this, Deviot should always use python2 to run the commands.

To the second issue:

  • Locate the file in Deviot/libs/Tools.py and change the line 210 to:
default_path = ["/usr/bin", "/usr/local/bin", "/usr/bin/env"]

Remove the folder Deviot located in Packages/User and restart ST. After this, the plugin should works without any extra change, and when the setup start it should say PlatformIO is installed in your system, you can enjoy Deviot now!

Let me know if that fixes works as I explained. If it does I'll add some new options to the next release.

@Jakeler
Copy link
Author

Jakeler commented Sep 15, 2016

That did not fix it unfortunately, i still get the same popup... Also the 2. issue (with the changed symlink).

btw, wouldn't it be easier if you put these experimental changes just into a other branch? (so you don't have to explain what i have to edit)

@gepd
Copy link
Owner

gepd commented Sep 16, 2016

Let's use this branch to do our test: https://github.com/gepd/Deviot/tree/newpython

Download and test it again

@Jakeler
Copy link
Author

Jakeler commented Sep 16, 2016

Okay, i fiddled around a while with this and i am still a bit confused what Sublime/Package Control does. It seems that you can't just change files (changes nothing, even with a restart), then there was a Backup folder with many Deviot folders in it that affected the result...
Anyway, i verified it in a fresh VM, it works now with python2!

But the issue with platformio is still present.

@gepd
Copy link
Owner

gepd commented Sep 16, 2016

I don't know why did you have problem, you can replace the files manually, I've do it without problem in some of my VMs

But that is a progress. I'll check again why isn't recognizing platformio previously installed.

@gepd
Copy link
Owner

gepd commented Sep 17, 2016

Please, Install newpython branch again, I've a new commit to fix the issue with PlatfomIO previously installed

@Jakeler
Copy link
Author

Jakeler commented Sep 17, 2016

PlatformIO is installed in your system, you can enjoy Deviot now!
Thanks a lot, works perfectly!

@gepd
Copy link
Owner

gepd commented Sep 17, 2016

Excellent, I still have to tune some things. I'll let you know when it's complete, but meanwhile you can use that version

@jwhendy
Copy link
Contributor

jwhendy commented Nov 2, 2016

Is this implemented in master or whatever default Package Control installs? I had some issues with stino after an Arch upgrade and stumbled on this so I thought I'd try it out.

I got the python errors as well and just decided to symlink /usr/bin/python -> /usr/bin/python2.7 for a quick fix. Worked fine, but prompted me to ask based on the above if this should have been required. If this is integrated into master, it didn't work for me on the first try. I don't see any references on the readme about it or how one would know they might run into this issue (and to use a different branch, how to specify the branch via Package Control, etc.).

Thanks!

@gepd
Copy link
Owner

gepd commented Nov 3, 2016

I still not release the new version with this feature, but it's in the newpython branch. You can Download it and replace the files in Packages/Deviot

The reference to the symlink in the install file in case you need it

@m4rcu5
Copy link
Contributor

m4rcu5 commented Jun 6, 2017

Any chance this can be pulled into master an released via Package Control? I think it is fairly common these days to have python2.7 and python3 installed, therefore encountering this issue.

@gepd
Copy link
Owner

gepd commented Jun 6, 2017

After some time away from this repository, I'm back to work in this issues, I hope to have all that features merge any time soon.

@gepd
Copy link
Owner

gepd commented Jun 20, 2017

I've improved this feature in the in the last version of the plugin, it's not released yet but you can help me to test it, more information here: #117

@jwhendy jwhendy mentioned this issue Jun 27, 2017
15 tasks
@gepd gepd closed this as completed Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants