# Sockets module not found (v0.7)

**URL:** https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476
**Category:** General Usage
**Created:** [June 6, 2018, 2:46pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476 "2018-06-06T14:46:15Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)
#### Post date: [June 6, 2018, 2:46pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/1 "2018-06-06T14:46:15Z")

</div>

I’m trying to get `HttpServer` to run on v0.7. It crashes because it attempts to use `Base.TCPServer`. Per the Julia docs, that has been moved under the `Sockets` module.  
However, attempting to add `using Sockets` to the `HttpServer` module crashes.

```julia
ERROR: LoadError: ArgumentError: Module Sockets not found in current path.
Run `Pkg.add("Sockets")` to install the Sockets package.
Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:868
 [2] include at ./boot.jl:314 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1071
 [4] include(::Module, ::String) at ./sysimg.jl:29
 [5] top-level scope
 [6] eval at ./boot.jl:316 [inlined]
 [7] eval(::Expr) at ./client.jl:394
 [8] macro expansion at ./none:3 [inlined]
 [9] top-level scope at ./<missing>:0
in expression starting at /Users/adrian/.julia/packages/HttpServer/ZGld/src/HttpServer.jl:11

```

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [June 6, 2018, 3:07pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/2 "2018-06-06T15:07:05Z")

</div>

Not sure, but I suspect this is just the fact that Pkg3 requires you to actually specify all of your dependencies (even, it would seem, on stdlib packages). See [Problem with reassignment of uuid when a package is registered - #18 by kristoffer.carlsson](https://discourse.julialang.org/t/problem-with-reassignment-of-uuid-when-a-package-is-registered/11422/18)

Can you `pkg> add Sockets` in the `HttpServer` project and see if that helps?

---

<div class="post-metadata">

### Author: ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)
#### Post date: [June 6, 2018, 7:33pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/3 "2018-06-06T19:33:28Z")

</div>

Thank you - yes, that’s right.  
`pkg> add` wasn’t enough (as far as I can tell). I had to do a `pkg> develop HttpServer` first.

---

<div class="post-metadata">

### Author: ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)
#### Post date: [June 8, 2018, 1:08pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/4 "2018-06-08T13:08:12Z")

</div>

Related to this, I keep bumping into this design problem as I upgrade my codebase to 0.7.

I have an ORM (`SearchLight`) which supports multiple backends (MySQL, SQLite, etc). I would like to avoid having all the backends as package dependencies (otherwise the user will have to install all of them, despite needing just one). But asking the user to do a `pkg> add MySQL` or adding MySQL to her project is not enough, is it? It seems that a user of `SearchLight` would have to add `MySQL` as a dependency of `SearchLight` as well?!

* * *

Also, it seems that doing a `pkg> add ` will overwrite the `Manifest.toml` for packages which are being checked-out with `pkg> develop` and changes in dependencies are lost.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 8, 2018, 4:25pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/5 "2018-06-08T16:25:33Z")

</div>

This PR may end up fixing this issue:

[https://github.com/JuliaLang/Pkg.jl/pull/357](https://github.com/JuliaLang/Pkg.jl/pull/357)

We use a regex to figure out what the stdlib dependencies of packages are when generating the registry from METADATA.jl since stdlib dependencies aren’t explicitly recorded anywhere. That script was not including `Sockets`. This fix still needs to get propagated to the machine that does the actual syncing, however, so it will take a little time. cc @kristoffer.carlsson

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 8, 2018, 4:28pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/6 "2018-06-08T16:28:01Z")

</div>

There’s a design for an “alternates” mechanism in Pkg3 but it’s not yet implemented. Until then, you’ve got to jump through some hoops to make this work. The easiest thing is to just declare a dependency on all of the backends you support. The trickier thing would be to load it via its name and UUID, but we don’t have an official way to do that at this point.

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [June 8, 2018, 7:14pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/7 "2018-06-08T19:14:36Z")

</div>

So does that mean that stdlib dependencies don’t need to be explicitly added with `pgk> add` to be available with `using`?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 8, 2018, 7:16pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/8 "2018-06-08T19:16:24Z")

</div>

Looks like this was a different issue—the version of the script that has been generating the registry has `Sockets` in it still.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 8, 2018, 7:19pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/9 "2018-06-08T19:19:35Z")

</div>

No, they do need to be added as explicit dependencies. This is just because the old package manager has no record of stdlib dependencies so we have to figure out which stdlibs a package depends on. It’s somewhat annoying to need to add stdlibs as dependencies, but after discussion, the conclusion was that making stdlibs as much like normal packages that happen to ship together with Julia itself was the way to go. And this will allow us to make breaking API changes in future Julia releases without breaking people’s old code as long as that code is explicit about which version of stdlibs it depends on (i.e. in a manifest file).

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [June 8, 2018, 7:29pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/10 "2018-06-08T19:29:44Z")

</div>

Got it, thank you!

---

<div class="post-metadata">

### Author: ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)
#### Post date: [June 8, 2018, 7:39pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/11 "2018-06-08T19:39:14Z")

</div>

I see - I will do that, thank you. Wondering what effect will this have on similar architectures, like `Plots.jl` for example. Curious how they’ll handle the various backends.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 8, 2018, 7:40pm UTC](https://discourse.julialang.org/t/sockets-module-not-found-v0-7/11476/12 "2018-06-08T19:40:25Z")

</div>

We’ll have some way to handle this in 0.7 final, it’s just not ready yet.
