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

Unable to use xPath commands #45

Open
ethanwebster-seekout opened this issue Nov 5, 2024 · 9 comments
Open

Unable to use xPath commands #45

ethanwebster-seekout opened this issue Nov 5, 2024 · 9 comments

Comments

@ethanwebster-seekout
Copy link

ethanwebster-seekout commented Nov 5, 2024

  • Installed xPath via PackageControl
  • Restarted Sublime to ensure installation completed
  • Opened a valid .xml file
  • When trying to copy xpath, the option to do so is greyed out
Screenshot 2024-11-05 at 2 27 59 PM
  • Looked in Sublime Console and see the following

File "/Users/ethanwebster/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/xpath.py", line 4, in <module> ImportError: No module named 'lxml' reloading plugin Default.keymap reloading plugin Default.kill_ring reloading plugin Default.mark reloading plugin Default.new_templates reloading plugin Default.open_context_url reloading plugin Default.open_in_browser reloading plugin Default.pane reloading plugin Default.paragraph reloading plugin Default.paste_from_history reloading plugin Default.profile reloading plugin Default.quick_panel reloading plugin Default.rename reloading plugin Default.run_syntax_tests reloading plugin Default.save_on_focus_lost reloading plugin Default.scroll reloading plugin Default.set_unsaved_view_name reloading plugin Default.settings reloading plugin Default.show_scope_name reloading plugin Default.side_bar reloading plugin Default.sort reloading plugin Default.switch_file reloading plugin Default.symbol reloading plugin Default.transform reloading plugin Default.transpose reloading plugin Default.ui reloading plugin CSS.css_completions reloading plugin Diff.diff reloading plugin HTML.encode_html_entities reloading plugin HTML.html_completions reloading plugin Package Control.plugin reloading plugin Pretty JSON.PrettyJson reloading plugin Pretty JSON.PrettyJsonListeners plugins loaded Package Control: The library "lxml" is not available for Python 3.3 on this platform, or this version of Sublime Text Package Control: Skipping automatic upgrade, last run at 2024-11-05 07:00:33, next run at 2024-11-05 15:00:33 or after Unable to open /Users/ethanwebster/Library/Application Support/Sublime Text/Packages/xpath/xpath.sublime-settings

@keith-hall
Copy link
Collaborator

Thanks for reporting. It looks like lxml (the Python package the xpath functionality relies on) is unavailable for Python 3.3 on Apple Silicon: eerohele/sublime-lxml#11
But we can try opting in to the Python 3.8 plugin host. You can try creating a .python-version file in your Packages/xpath folder with 3.8 as the contents of said file, and restart ST after running Package Control: Satisfy libraries in the Command Palette.

@ethanwebster-seekout
Copy link
Author

Thanks Keith. This is on my work computer and looks like I do not have access to that file structure, so I don't think I will be able to make this change. Feel free to close.

@keith-hall
Copy link
Collaborator

I took the time to investigate and experiment a bit. I have made some changes which should fix this in #46 - you'll just need to wait for the next release of this package :)

@ethanwebster-seekout
Copy link
Author

You are a huge help Keith and thank you. I'll be watching for the release and report back.

@rosshadden
Copy link
Owner

#46 is merged. Thanks @keith-hall

@keith-hall
Copy link
Collaborator

Thanks. Waiting for wbond/package_control_channel#8999 to get merged, then Package Control's crawler will pick up the new release.

@keith-hall
Copy link
Collaborator

The latest release of this plugin is available on Package Control now btw. Package Control should upgrade it automatically for you, but if not, try the Package Control: Upgrade Package entry in the Command Palette. You may find you still need to do some manual steps to get it working: https://github.com/rosshadden/sublime-xpath?tab=readme-ov-file#mac
Restarting ST after upgrading xpath or lxml is advised.

@ethanwebster-seekout
Copy link
Author

I followed those steps and also had to run the command echo "alias python=/usr/bin/python3" >> ~/.zshrc. However, when I go to copy the build file, there is no 'Sublime Text' folder structure inside of 'Application Support'.

@keith-hall
Copy link
Collaborator

Hmm, if you have Sublime Text open, and you go to the Sublime Text menu -> Settings -> Browse Packages, where does that take you? Going up one level from there should present you with the Lib subfolder

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