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

pygtk —with-libglade on Mac does not work #14

Open
rindlchen opened this issue Jun 26, 2019 · 10 comments
Open

pygtk —with-libglade on Mac does not work #14

rindlchen opened this issue Jun 26, 2019 · 10 comments

Comments

@rindlchen
Copy link

Hi,
i followed the README.MacOS and got all the way to
brew install pygtk --with-libglade
which only gives the error
Error: invalid option: --with-libglade

I can compile without libglade but p4v won't run.
what is the correct way to link libglade to pygtk now?

thank you for your help

@Chengcheng-Xiao
Copy link
Contributor

Chengcheng-Xiao commented Jun 26, 2019

Check out my fix:
https://github.com/Chengcheng-Xiao/p4vasp
especially the updated README.MacOS

In short:
Download brew_pygtk.rb(https://raw.githubusercontent.com/Chengcheng-Xiao/p4vasp/master/brew_pygtk.rb)

brew install --build-from-source ./brew_pygtk.rb —-with-libglade

I've put up a pull-request for this.

@rindlchen
Copy link
Author

rindlchen commented Jun 27, 2019

if I do this, I get

Error: No available formula with the name "brew_pygtk"
In formula file: /src/p4vasp-master/brew_pygtk.rb
Expected to find class BrewPygtk, but only found: Pygtk.

@Chengcheng-Xiao
Copy link
Contributor

Chengcheng-Xiao commented Jun 28, 2019

Thank you for brining this to attention.

It seems the homebrew formula file should always be named after the name of the class. LINK

Simply change the name of the brew_pygtk.rb file to pygtk.rb should do the trick.

I will submit an updated pull request later.

@rindlchen
Copy link
Author

thank you.
however, it seems to work only with the options as prefix
brew install --build-from-source --with-libglade ./pygtk.rb

@Chengcheng-Xiao
Copy link
Contributor

Maybe its a shell dependent thing, I use zsh and the postfix option works fine.

I suggest you check your brew build by:

brew info pygtk

if the output looks like the following, then it should be fine:

pygtk: stable 2.24.0 (bottled)
GTK+ bindings for Python
http://www.pygtk.org/
/usr/local/Cellar/pygtk/2.24.0_2 (661 files, 15.9MB) *
  Built from source on 2019-06-28 at 20:18:58 with: --with-libglade
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/pygtk.rb
==> Dependencies
Build: pkg-config ✔
Required: atk ✔, glib ✔, gtk+ ✔, py2cairo ✔, pygobject ✔
==> Analytics
install: 7,912 (30 days), 15,538 (90 days), 53,252 (365 days)
install_on_request: 1,361 (30 days), 2,600 (90 days), 9,437 (365 days)
build_error: 0 (30 days)

Note the --with-libglade option labeled after the build information.

P.S. for all suffering from this problem: Checking homebrew build log at ~/Library/Logs/Homebrew/pygtk should always be helpful 😉.

@heyselbi
Copy link

heyselbi commented Mar 6, 2020

I am struggling to install the pygtk with libglade.
brew install --build-from-source ./pygtk.rb —-with-libglade
This gives:

Error: No available formula with the name "—-with-libglade" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

I tried looking up how to fix it etc, but to no avail so far.
I use MacOS Catalina and all other installs for p4vasp has worked fine, except the pygtk.

When I do:
brew info pygtk

I get:

pygtk: stable 2.24.0
GTK+ bindings for Python
http://www.pygtk.org/
/usr/local/Cellar/pygtk/2.24.0_3 (593 files, 15.5MB) *
  Poured from bottle on 2020-03-05 at 16:08:02
From: /usr/local/opt/pygtk/.brew/pygtk.rb
==> Dependencies
Build: pkg-config ✘
Required: atk ✔, glib ✔, gtk+ ✔, libglade ✔, py2cairo ✔, pygobject ✔

Would anyone have any suggestion? Or has anyone else struggled installing p4vasp on Catalina?

@rijal1370
Copy link

any news on p4vasp installation probelm in macOS because all of the processes mentioned above (./pygtk.rb and ./brew_pygtk.rb) lead to the same error
Error: No available formula with the name

@Chengcheng-Xiao
Copy link
Contributor

Chengcheng-Xiao commented May 6, 2020

According to Homebrew cookbook.
You can probably put brew_pygtk.rb in

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

and then install it with brew install brew_pygtk. I don't have any 10.15 machine to test this but it might work.

Or you can tap into my brew repo:

brew tap chengcheng-xiao/extras

and try to install it as usual.

Also, just to point out, pygtk is no longer actively maintained and the last release dates back to 2011... so... 😂

@shiruigithub
Copy link

According to Homebrew cookbook.
You can probably put brew_pygtk.rb in

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

and then install it with brew install brew_pygtk. I don't have any 10.15 machine to test this but it might work.

Or you can tap into my brew repo:

brew tap chengcheng-xiao/extras

and try to install it as usual.

Also, just to point out, pygtk is no longer actively maintained and the last release dates back to 2011... so... 😂

I tried to install 'pygtk' according to Chengcheng-Xiao's method by tapping his brew repo, and this gives:

Updating Homebrew...
==> Installing pygtk from chengcheng-xiao/extras
Error: No available formula with the name "pygobject" (dependency of chengcheng-xiao/extras/pygtk)
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
This similarly named formula was found:
pygobject3 ✔
To install it, run:
  brew install pygobject3 ✔
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

It seems that the dependency 'pygobject' was removed from Homebrew/core.
Could you provide the dependency in your brew repo? Thank you

@Chengcheng-Xiao
Copy link
Contributor

Homebrew is and always has been aggressive in terms of updating their package libraries. So, I think we are going to see more of these deprecated libraries in the future (especially since python@2 is now deprecated, any package that depends on it will also be deemed deprecated).

That leaves us with three options:

  • update the main package with python@3 and updated libraries.
  • choose an alternative software.
  • find a way to install the deprecated libraries.

The first option needs someone with good knowledge of the code and tons of free time, so I don't think it's going to happen any time soon. The second option is much simpler: I recommend pyband for anyone who only wants to analyze band structure and DOS.

Now, on to the third option. Surely, I can provide a brew formula and be done with it, but I don't think that's a good idea for the upcoming tsunami of deprecated libraries. So, instead, I'll provide a brief tutorial on how to do this yourself:

  1. Be sure to know which package you are searching for.
  2. Go to the main library and type in the formula name search box located at the upper left corner. Select "search in this repository "
  3. In the search page, click commits and sort the result chronologically. You will find some info about "deleted due to blah blah blah" and, for best practice, choose the one before that commit and click it.
  4. Now you have arrived at the commit specification page. To find the file you want, click the three little dots on the right corner of the git diff block, select view file. Voila, the .rb file is here!
  5. Just copy and paste the .rb file into your /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ or make your own Github repo with it, whatever you like. However, please note that this file is not guaranteed to work. Basically, the longer that formula has been deprecated, the more possible it could be broken and need to be fixed.
  6. There is no universal way of fixing the formula so to do this, I refer to the documentation: https://docs.brew.sh/Formula-Cookbook

I'll post the URL of the most recent commit of the pygobject formulae HERE but I highly doubt it will work out of the box. I'm a little busy now so I won't do this anytime soon, but I bet with a little googling, anyone can do it! 🥳

jrbp pushed a commit to jrbp/p4vasp that referenced this issue Mar 1, 2023
Resolve "Missing kpoint labels not working"

Closes orest-d#14

See merge request schlipf/py4vasp!12
jrbp pushed a commit to jrbp/p4vasp that referenced this issue Mar 1, 2023
We can use the Topology class like the Trajectory information instead of 
redefining another way to extract the species information from the file.

The position are actually in crystal units not in cartesian ones

Add from_file method
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

5 participants