# PhysicalConstants package with Julia 1.0.1.1?

**URL:** <https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189>\
**Category:** General Usage\
**Tags:** package, unitful\
**Created:** [October 11, 2018, 4:23pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189 "2018-10-11T16:23:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![astrowanders](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@astrowanders](https://discourse.julialang.org/u/astrowanders)\
**Post date:** [October 11, 2018, 4:23pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/1 "2018-10-11T16:23:03Z")

</div>

Hello,

I’ve been using the[PhysicalConstants.jl](https://github.com/DataWookie/PhysicalConstants.jl) package for some time now, and greatly appreciate the ability to define CGS or MKS units. We use CGS units in astrophysics.

The PhysicalConstants package was developed about 3 years ago - I think Julia was in beta? I’ve been able to install and use it up to Julia 1.0.1.

 ![00%20PM](https://global.discourse-cdn.com/julialang/original/3X/0/8/086641f5873135a6bfb1e7f92ea8905dbcf7c866.png)  
However, I can’t seem to install it with Julia 1.0.1.1. Is there a way around this error? Also, I would appreciate any recommendations for similar packages.  
 ![07%20PM](https://global.discourse-cdn.com/julialang/original/3X/6/a/6acb6149335fe6e2ae738818b7c81f956150de60.png)

---

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [October 11, 2018, 9:21pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/2 "2018-10-11T21:21:49Z")

</div>

That package seems to be abandoned, however there is another package with the same name that is still under active development:

[https://github.com/JuliaPhysics/PhysicalConstants.jl](https://github.com/JuliaPhysics/PhysicalConstants.jl)

This new package fully hooks into the [Unitful.jl](https://github.com/ajkeller34/Unitful.jl) ecosystem, so it should be possible to convert the constants into whichever unit system suits you best.

---

<div class="post-metadata">

**Author:** ![abobroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abobroff/32/3752_2.png) [@abobroff](https://discourse.julialang.org/u/abobroff)\
**Post date:** [October 11, 2018, 10:18pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/3 "2018-10-11T22:18:31Z")

</div>

My download experience for Unitful:

```julia
Press Enter to start Julia.
Starting Julia...
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.1 (2018-09-29)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(JuliaPro_v1.0.1.1) pkg> st
    Status `J:\JuliaPro-1.0.1.1\pkgs-1.0.1.1\environments\JuliaPro_v1.0.1.1\Project.toml`
  [c52e3926] Atom v0.7.6
  [682c06a0] JSON v0.19.0
  [e5e0dc1b] Juno v0.5.3

(JuliaPro_v1.0.1.1) pkg> add Unitful
  Updating registry at `J:\JuliaPro-1.0.1.1\pkgs-1.0.1.1\registries\JuliaPro`
  Updating git-repo `https://pkg.juliacomputing.com/registry/JuliaPro`
ERROR: The following package names could not be resolved:
 * Unitful (not found in project, manifest or registry)
Please specify by known `name=uuid`.

(JuliaPro_v1.0.1.1) pkg>

```

Use:

JuliaPro-v1.0.1.1

Windows 10 - x64

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 11, 2018, 10:28pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/4 "2018-10-11T22:28:12Z")

</div>

Apparently JuliaPro does not come with the `General` package registry, so you only have access to a subset of packages.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [October 11, 2018, 11:27pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/5 "2018-10-11T23:27:52Z")

</div>

Yes, JuliaRun uses a smaller registry of supported packages. We do need to

a) document this better  
b) document the list of packages  
c) document a way to switching to the General registry.

All of this is forthcoming. Apologies for the trouble, but we wanted to get the bits out while we round out the documentation around it.

Regards

Avik

---

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [October 12, 2018, 1:27am UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/6 "2018-10-12T01:27:09Z")

</div>

Where does the Julia Computing registry live?

---

<div class="post-metadata">

**Author:** ![daxinnan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daxinnan/32/3036_2.png) [@daxinnan](https://discourse.julialang.org/u/daxinnan)\
**Post date:** [October 12, 2018, 2:18pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/7 "2018-10-12T14:18:56Z")

</div>

So can I change the Julia\_Pkg\_Server in JuliaPro?

---

<div class="post-metadata">

**Author:** ![hotplot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hotplot/32/5733_2.png) [@hotplot](https://discourse.julialang.org/u/hotplot)\
**Post date:** [October 14, 2018, 3:03am UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/8 "2018-10-14T03:03:21Z")

</div>

It appears that you can switch to the General registry in JuliaPro by deleting the following folder:

```
C:\Users\Name\AppData\Local\JuliaPro-1.0.1.1\pkgs-1.0.1.1\registries

```

Next time you use `add <package>` it will clone the General registry before attempting to install the requested package.

---

<div class="post-metadata">

**Author:** ![sgt101](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sgt101](https://discourse.julialang.org/u/sgt101)\
**Post date:** [October 17, 2018, 8:14pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/9 "2018-10-17T20:14:21Z")

</div>

It really, really, really, really would be a good idea to flag the specialist package registry to Juliapro users. I have just spent half a day wondering what had gone wrong.

I am a bit bewildered as to what the logic for a different registry is?

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [October 17, 2018, 9:45pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/10 "2018-10-17T21:45:51Z")

</div>

Everytime I see the headline Julia 1.0.1.1 I think there has been a new minor-minor release of Julia. Then I realize it’s just JuliaPro.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [October 21, 2018, 12:27pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/11 "2018-10-21T12:27:09Z")

</div>

> [@e3c6](#):
>
> Everytime I see the headline Julia 1.0.1.1 I think there has been a new minor-minor release of Julia.

We do want JuliaPro to track the version of Julia it is bundled with, but yet also have something distinguish it from base Julia. Hence the slightly longer version number. But I’m happy to hear suggestions of doing that better – I realise four digits makes it a bit too long and awkward.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [October 21, 2018, 3:27pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/12 "2018-10-21T15:27:20Z")

</div>

In Debian [they use](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-standards-version) `x.y.z-r`, where `x.y.z` is the version of the unmodified upstream package, `r` is the Debian revision: `1.0.1-1`. The `-` in place of the `.` makes it a bit clearer the difference. Another option, always stolen from Debian packages naming, is to append “+pro” and then the revision number: `1.0.1+pro1`. A bit more verbose, but unambiguous.

What is nice is that, contrary to `1.0.1.1`, both `1.0.1-1` and `1.0.1+pro1` are valid `VersionNumber`:

```julia
julia> dump(v"1.0.1-1")
VersionNumber
  major: UInt32 0x00000001
  minor: UInt32 0x00000000
  patch: UInt32 0x00000001
  prerelease: Tuple{UInt64}
    1: UInt64 0x0000000000000001
  build: Tuple{} ()

julia> dump(v"1.0.1+pro1")
VersionNumber
  major: UInt32 0x00000001
  minor: UInt32 0x00000000
  patch: UInt32 0x00000001
  prerelease: Tuple{} ()
  build: Tuple{String}
    1: String "pro1"

julia> dump(v"1.0.1.1")
ERROR: LoadError: ArgumentError: invalid version string: 1.0.1.1
Stacktrace:
 [1] VersionNumber(::String) at ./version.jl:111
 [2] @v_str(::LineNumberNode, ::Module, ::Any) at ./version.jl:138
in expression starting at REPL[10]:100:

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 4, 2019, 10:14pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/13 "2019-04-04T22:14:52Z")

</div>

For the record, the first version of [`PhysicalConstants.jl`](https://github.com/JuliaPhysics/PhysicalConstants.jl) has been release (see [the announcement](https://discourse.julialang.org/t/ann-rfc-new-package-physicalconstants-jl/14737/4)).

---

<div class="post-metadata">

**Author:** ![astrowanders](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@astrowanders](https://discourse.julialang.org/u/astrowanders)\
**Post date:** [April 9, 2019, 6:35pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/14 "2019-04-09T18:35:20Z")

</div>

Thanks. I’ll note that I liked [Andrew Collier’s version](https://github.com/DataWookie/PhysicalConstants.jl) because it permitted users to specify CGS or MKS units.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 9, 2019, 7:50pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189/15 "2019-04-09T19:50:23Z")

</div>

That package literally knows nothing of units, just provides the values of constants in different unit systems. You have to manually do any conversion.

PhysicalConstants.jl relies on Unitful.jl for dealing with units, which is more robust and less error-prone. Maybe within Unitful.jl there could be a way to choose a base unit system, but I don’t have a strong feeling about this. I just want to be able to use a constant without constantly checking that I’m not messing up units
