cabal install hsparql error - haskell

Im trying to install hsparql, cabal version 1.22.1.1
cabal install hsparql
gives
Could not find module `Network.URI'
It is a member of the hidden package `network-uri-2.6.0.1'.
Perhaps you need to add `network-uri' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
Failed to install hsparql-0.2.5
cabal: Error: some packages failed to install:
hsparql-0.2.5 failed during the building phase. The exception was:
ExitFailure 1
but
cabal install network-uri
shows
All the requested packages are already installed:
network-uri-2.6.0.1
what could be the problem?

Related

Cabal: File in tar archive is not in the expected directory

I have been unable to install any packages using Cabal, getting an error saying that the tar archive is not in the expected directory. For example, if I try to do, cabal install mtl, I get the following error:
Resolving dependencies...
Failed to install text-1.2.1.1
cabal: Error: some packages failed to install:
text-1.2.1.1 failed while unpacking the package. The exception was:
user error (File in tar archive is not in the expected directory. Expected:
"." but got the following hierarchy: ["text-1.2.1.1"])
I have run cabal update, and cabal --version gives the following:
$ cabal --version
cabal-install version 1.22.5.0
using version 1.22.4.0 of the Cabal library
Anyone have any ideas as to why this might be happening? Let me know if you need any additional information.
That version of cabal-install had a big making it almost completely unusable. Upgrading should solve this problem.

Failed to install http-conduit-1.9.6

I'm trying to install http-conduit-1.9.6, and running cabal install http-conduit-1.9.6 gives me the following error:
Network/HTTP/Conduit/Request.hs:43:8:
Could not find module `Network.URI'
It is a member of the hidden package `network-2.5.0.0'.
Perhaps you need to add `network' to the build-depends in your .cabal file.
It is a member of the hidden package `network-2.4.1.2'.
Perhaps you need to add `network' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
Failed to install http-conduit-1.9.6
World file is already up to date.
cabal: Error: some packages failed to install:
http-conduit-1.9.6 failed during the building phase. The exception was:
ExitFailure 1
I have installed network-2.5.0.0 and network-2.4.1.2, the output of ghc-pkg list network is:
/var/lib/ghc/package.conf.d
/root/.ghc/x86_64-linux-7.6.3/package.conf.d
network-2.4.1.2
network-2.5.0.0
network-2.6.0.2
I'm new with Haskell, and I'm now sure if having two repositories could be a problem. My work platform is Ubuntu 14.04, GHC 7.6.3, and cabal 1.20.

Can't install sdl2 via cabal

I am trying to install helm. When I try to install it, however I get this error:
$ cabal install helm
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
helm-0.6.1 depends on sdl2-1.1.0 which failed to install.
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
When I go to install sdl2 by itself, I get a similar message.
$ cabal install sdl2
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
I don't understand. According to Hackage, sdl2 is at version 1.1, but installing it requires version 2.0.3? I've tried this in and out of a sandbox. Results of ghc-pkg list are here if you think they're relevant: http://pastebin.com/tFrsfPFe
I'm on Ubuntu btw.
Help?
Another thing which could happen (happened to me) for other installs is that the PKG_CONFIG_PATH variable might not point to the package config file (sdl2.pc, for me in the /usr/local/lib/pkgconfig directory). pkg-config uses some default directories ('/usr/lib/pkgconfig' and '/usr/share/pkgconfig'), but if the sdl.pc file isn't in one of these, you'll have to specify the directory in the environment variable. You can check this with echo $PKG_CONFIG_PATH
If it turns out you need to set the variable, just use export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig (or to whatever directory your sdl2.pc file lives in)
I ran into the same problem, and I just want to add my solution here for the record. The native sdl2 libraries need to be installed first by following the directions here: https://github.com/haskell-game/sdl2#building

Cabal installation issues on Windows

I am having some issues installing packages on Windows using cabal. The following command:
cabal install ghc-mod
produces these errors
C:\temp> cabal install ghc-mod
Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal.exe: Error: some packages failed to install:
ghc-mod-4.1.3 depends on haskell-src-exts-1.15.0.1 which failed to install.
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\...\AppData\Local\Temp\haskell-src-exts-1.15.0.1-55548\haskell-src- exts-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist":
permission denied (Acesso negado.)
hlint-1.9 depends on haskell-src-exts-1.15.0.1 which failed to install.
I have also tried:
cabal install haskell-src-exts
However I got the same error.
can someone help me?
UPDATE
Output error executing cabal install haskell-src-exts:
c:\> cabal install haskell-src-exts
Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal: Error: some packages failed to install:
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\DIULLE~1\AppData\Local\Temp\haskell-src-exts-1.15.0.1-35992\haskell-src-exts-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist":
permission denied (Acesso negado.)
This has been a known bug for some time1, and seems to be fixed six days ago, so update your cabal2:
> cabal update
> cabal install cabal cabal-install
> cabal install ghc-mod
However, if you don't want to jump on the cabal-git-train, you can still unpack, configure and install packages by hand. This will prevent the behaviour, since it is triggered by moving temporary dictionaries and name clashes:
> cabal unpack haskell-src-exts
> cd haskell-src-exts*
> cabal configure
> cabal build
> cabal install
1: since the bug has been reported on 22nd Feb, it seems to affect all versions from >= 1.18.* to < 1.20.0.3.
2: make sure that you really run the new version.

Haskell cabal-install errors

I am having lots of problems with cabal-install:
1: Every time I do cabal update, it tells me to do cabal install cabal-install, so I do, and then when I do cabal update again, it says the same thing.
2: When I try to install ghc-mod from hackage, it gives me this error:
[username#arch ~]$ cabal install ghc-mod
In order, the following will be installed:
haskell-src-exts-1.14.0 (reinstall) changes: pretty-1.1.1.1 -> 1.1.1.0
hlint-1.8.55 (reinstall)
ghc-mod-3.1.4
setup: The program happy version >=1.17 is required but it could not be found.
ghc-mod-3.1.4 depends on haskell-src-exts-1.14.0 which failed to install.
haskell-src-exts-1.14.0 failed during the configure step.
hlint-1.8.55 depends on haskell-src-exts-1.14.0 which failed to install.
So the problem was The program happy version >=1.17 is required but it could not be found., so I installed happy 1.19.2 using cabal install happy without problems.
I tried cabal install ghc-mod again, same error, so I tried cabal install haskell-src-exts --reinstall --force-reinstalls. It gave me the following error:
[username#arch ~]$ cabal install haskell-src-exts --reinstall --force-reinstalls
Configuring haskell-src-exts-1.14.0...
setup: The program happy version >=1.17 is required but it could not be found.
Failed to install haskell-src-exts-1.14.0
cabal: Error: some packages failed to install:
haskell-src-exts-1.14.0 failed during the configure step. The exception was:
ExitFailure 1
Basically The program happy version >=1.17 is required but it could not be found.. So happy is the problem again?
I have also tried downloading the tar.gz files from hackage and using cabal install on the
.cabal file, also modified the .cabal file to ignore dependencies, still failed.
cabal install places executables in ~/.cabal/bin.
If you add it to your path, you will be able to use the new executables installed by cabal:
$ PATH=$HOME/.cabal/bin:$PATH
I encountered with same problem and I solved the problem with installing happy package(confusing package name). So install it with your package manager(apt-get, pacman etc) before install package with cabal. This should be fix the problem.

Resources