How to install your source as a package on heroku - heroku

Im looking to install a custom package on heroku. I have the following folder structure.
├─ src
│ ├─ packagename
│ │ ├─ __init__.py
│ │ └─ ...
│ └─ setup.py
├─ tests
│ └─ ...
└─ Procfile
Locally I run the following to make the package structure importable.
$ cd src
$ pip install -e .
How do I add that step to build process in heroku?

The trick is to add it to the requirements.txt file with the -e flag. Found it out from looking at the docs on how to handle local file-backed distributions.

Related

Laravel TALL npm run dev --openssl-legacy-provider is not allowed in NODE_OPTIONS

I have just updated the npm packages of my Laravel project right at my MacOS system (I have been developing on Laravel Homestead since so long but npm didn't work for me),
% npm list
% npm update -D
% npm list to compare the versions differences
% npm install
also brew update and brew upgrade (on MacOS).
So I got now the following versions:
% npm -v: 8.1.0
├── #fortawesome/fontawesome-free#5.15.4
├── #tailwindcss/forms#0.3.4
├── #tailwindcss/typography#0.4.1
├── alpinejs#3.4.2
├── axios#0.21.4
├── laravel-mix#6.0.35
├── lodash#4.17.21
├── postcss-import#14.0.2
├── postcss#8.3.11
├── resolve-url-loader#4.0.0
├── sass-loader#12.3.0
├── sass#1.43.4
├── sweetalert2#11.1.9
└── tailwindcss#2.2.17
When I run $ npm run dev nothing happens and I get the following message:
% npm run dev
> dev
> npm run development
> development
> mix
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
What do I do to fix it?
Workaround
I ran $ npm run dev right inside the Ubuntu Laravel Homestead and it worked! At the end I got the following messages:
webpack compiled successfully
npm notice
npm notice New major version of npm available! 7.12.1 -> 8.1.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.2
npm notice Run npm install -g npm#8.1.2 to update!
npm notice
But I won't update, since I'm afraid I'll get the same error.
Notice:
% => I am running on MacOS.
$ => I am running on Ubuntu.
Update
I have just updated again everything with
% brew update
% brew upgrade
Then I ran again
% npm run dev even if I still got npm -v => 8.1.0, but my packages have been updated:
├── #fortawesome/fontawesome-free#5.15.4
├── #tailwindcss/forms#0.3.4
├── #tailwindcss/typography#0.4.1
├── alpinejs#3.5.0
├── axios#0.21.4
├── laravel-mix#6.0.39
├── lodash#4.17.21
├── postcss-import#14.0.2
├── postcss#8.3.11
├── resolve-url-loader#4.0.0
├── sass-loader#12.3.0
├── sass#1.43.4
└── tailwindcss#2.2.19
and it's working normally again!
For me the cause was node version 17.
I downgraded node to version 16 (LTS) and it worked.
See also the answer here https://stackoverflow.com/a/70286141/936284
unset NODE_OPTIONS
worked for me

Having trouble installing create-react-app...getting this error Cannot find module 'rxjs'

When using the command, npx create-react-app tconnect it fails with the following error:
Error: Cannot find module 'rxjs'
I have the latest stable version of node. I also tried reinstalling npm and yarn.
Below is the output from my terminal:
///////////////////////////////////////////////////////////////////////////
➜ Projects git:(master) ✗ npx create-react-app tconnect
npx: installed 91 in 3.968s
Creating a new React app in /Users/punchcode/Projects/tconnect.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.17.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" has unmet peer dependency "typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 36 new dependencies.
info Direct dependencies
├─ cra-template#1.0.0
├─ react-dom#16.12.0
├─ react-scripts#3.3.0
└─ react#16.12.0
info All dependencies
├─ #babel/plugin-proposal-class-properties#7.7.4
├─ #babel/plugin-proposal-decorators#7.7.4
├─ #babel/plugin-proposal-nullish-coalescing-operator#7.7.4
├─ #babel/plugin-proposal-numeric-separator#7.7.4
├─ #babel/plugin-proposal-optional-chaining#7.7.4
├─ #babel/plugin-syntax-decorators#7.8.3
├─ #babel/plugin-syntax-flow#7.8.3
├─ #babel/plugin-syntax-nullish-coalescing-operator#7.8.3
├─ #babel/plugin-syntax-numeric-separator#7.8.3
├─ #babel/plugin-syntax-optional-chaining#7.8.3
├─ #babel/plugin-syntax-typescript#7.8.3
├─ #babel/plugin-transform-flow-strip-types#7.7.4
├─ #babel/plugin-transform-runtime#7.7.4
├─ #babel/plugin-transform-typescript#7.8.3
├─ #babel/preset-typescript#7.7.4
├─ #types/parse-json#4.0.0
├─ babel-plugin-macros#2.7.1
├─ babel-plugin-named-asset-import#0.3.5
├─ babel-preset-react-app#9.1.0
├─ core-js#3.6.4
├─ cra-template#1.0.0
├─ eslint-config-react-app#5.1.0
├─ fork-ts-checker-webpack-plugin#3.1.0
├─ lines-and-columns#1.1.6
├─ open#7.0.0
├─ promise#8.0.3
├─ raf#3.4.1
├─ react-app-polyfill#1.0.5
├─ react-dev-utils#10.0.0
├─ react-dom#16.12.0
├─ react-error-overlay#6.0.4
├─ react-scripts#3.3.0
├─ react#16.12.0
├─ scheduler#0.18.0
├─ whatwg-fetch#3.0.0
└─ yaml#1.7.2
✨ Done in 9.23s.
internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module 'rxjs'
Require stack:
- /Users/punchcode/Projects/tconnect/node_modules/inquirer/lib/ui/prompt.js
- /Users/punchcode/Projects/tconnect/node_modules/inquirer/lib/inquirer.js
- /Users/punchcode/Projects/tconnect/node_modules/react-dev-utils/browsersHelper.js
- /Users/punchcode/Projects/tconnect/node_modules/react-scripts/scripts/init.js
- /Users/punchcode/Projects/tconnect/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
at Function.Module._load (internal/modules/cjs/loader.js:686:27)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/punchcode/Projects/tconnect/node_modules/inquirer/lib/ui/prompt.js:3:34)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/punchcode/Projects/tconnect/node_modules/inquirer/lib/ui/prompt.js',
'/Users/punchcode/Projects/tconnect/node_modules/inquirer/lib/inquirer.js',
'/Users/punchcode/Projects/tconnect/node_modules/react-dev-utils/browsersHelper.js',
'/Users/punchcode/Projects/tconnect/node_modules/react-scripts/scripts/init.js',
'/Users/punchcode/Projects/tconnect/[eval]'
]
}
Aborting installation.
node has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting tconnect/ from /Users/punchcode/Projects
Done.
It could be a number of things. I'd suggest a sanity check, in which case we'll assume that something is broken in your particular case with npx-
So try the alternatives:
npm install create-react-app and then create-react-app
OR install create-react-app via Yarn
If this doesn't work try Facebook's suggestion (in the event you may have installed create-react-app globally):
If you've previously installed create-react-app globally via npm
install -g create-react-app, we recommend you uninstall the package
using npm uninstall -g create-react-app to ensure that npx always uses
the latest version.
source: https://github.com/facebook/create-react-app/blob/master/README.md

not able to downgrade from maven 3.5.2 to maven 3.0.4 : No available formula with the name "maven30"

I have uninstalled maven using
brew uninstall maven
and tried to install it again using
brew install maven30
but I got this error
brew install maven30
Error: No available formula with the name "maven30"
==> 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...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: curl is not executable
however when I use brew install maven it got downloaded and installed as well
brew install maven
==> Downloading https://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.5.2/b
Already downloaded: /Users/amar/Library/Caches/Homebrew/maven-3.5.2.tar.gz
🍺 /usr/local/Cellar/maven/3.5.2: 104 files, 10.1MB, built in 3 seconds
so why I am getting curl is not executable in maven30
I also tried
brew tap homebrew/versions
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
I downloaded the mvn zip file for 3.0.4 from here and then executed mvn command located in bin file as shown below
amar#admin:~/Downloads/apache-maven-3.0.4$ tree -L 2
├── LICENSE.txt
├── NOTICE.txt
├── README.txt
├── bin
│   ├── m2.conf
│   ├── mvn
│   ├── mvn.bat
│   ├── mvnDebug
│   ├── mvnDebug.bat
│   └── mvnyjp
Now go the bin folder and query for version
amar#admin:~/Downloads/apache-maven-3.0.4/bin$ ./mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
Now it is working fine, another step is to uninstall the current version and unlink it as well using brew uninstall maven and brew unlink maven
now you can add the path of your current maven binary in bash_profile and sourced it. below is the example
export M2_HOME=/Users/amar/Downloads/apache-maven-3.0.4
export PATH=$PATH:$M2_HOME/bin
try checking version again, it worked for me
amar#admin:~$ mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /Users/amar/Downloads/apache-maven-3.0.4
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"
amar#admin:~$

gatsby failed due to missing regenerator-runtime/runtime module

I am trying out gatsby
Here is how I install gatsby-cli:
$ npm install --global gatsby-cli
/Users/antkong/.nvm/versions/node/v4.8.6/bin/gatsby -> /Users/antkong/.nvm/versions/node/v4.8.6/lib/node_modules/gatsby-cli/lib/index.js
gatsby-cli#1.1.20 /Users/antkong/.nvm/versions/node/v4.8.6/lib/node_modules/gatsby-cli
├── convert-hrtime#2.0.0
├── hosted-git-info#2.5.0
├── stack-trace#0.0.10
├── resolve-cwd#2.0.0 (resolve-from#3.0.0)
├── source-map#0.5.7
├── bluebird#3.5.1
├── babel-code-frame#6.26.0 (js-tokens#3.0.2, esutils#2.0.2, chalk#1.1.3)
├── execa#0.8.0 (p-finally#1.0.0, strip-eof#1.0.0, is-stream#1.1.0, get-stream#3.0.0, signal-exit#3.0.2, npm-run-path#2.0.2, cross-spawn#5.1.0)
├── fs-extra#4.0.2 (universalify#0.1.1, jsonfile#4.0.0, graceful-fs#4.1.11)
├── common-tags#1.4.0
├── yargs#8.0.2 (decamelize#1.2.0, get-caller-file#1.0.2, camelcase#4.1.0, y18n#3.2.1, which-module#2.0.0, set-blocking#2.0.0, yargs-parser#7.0.0, require-main-filename#1.0.1, require-directory#2.1.1, string-width#2.1.1, cliui#3.2.0, os-locale#2.1.0, read-pkg-up#2.0.0)
├── yurnalist#0.2.1 (strip-bom#3.0.0, detect-indent#5.0.0, leven#2.1.0, semver#5.4.1, object-path#0.11.4, death#1.1.0, is-builtin-module#1.0.0, is-ci#1.0.10, chalk#1.1.3, debug#2.6.9, node-emoji#1.8.1, read#1.0.7, loud-rejection#1.6.0, invariant#2.2.2, rimraf#2.6.2, inquirer#3.3.0)
├── pretty-error#2.1.1 (utila#0.4.0, renderkid#2.0.1)
├── babel-runtime#6.26.0 (regenerator-runtime#0.11.0)
├── lodash#4.17.4
└── core-js#2.5.1
Then when I tried to print out the version to see if the installation is successful, I got this:
$ gatsby --version
module.js:327
throw err;
^
Error: Cannot find module 'regenerator-runtime/runtime'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/antkong/.nvm/versions/node/v4.8.6/lib/node_modules/gatsby-cli/lib/index.js:88:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
My version of npm and node
$ node --version
v4.8.6
$ npm --version
2.15.11
OS platform is macOS High Sierra
What did I miss during the installation?
We're not supporting Node 4 anymore — try upgrading to Node 8 & NPM 5 and it should be smooth sailing!

brew install i386-elf-gcc and error:contains conflicting version recursive dependencies

brew install i386-elf-gcc
==> Installing i386-elf-gcc from altkatz/gcc_cross_compilers
Error: altkatz/gcc_cross_compilers/i386-elf-gcc contains conflicting version recursive dependencies:
gmp, gmp#4, mpfr, mpfr#2, libmpc, libmpc#0.8
View these with brew deps --tree altkatz/gcc_cross_compilers/i386-elf-gcc.
And the debs tree looks like:
altkatz/gcc_cross_compilers/i386-elf-gcc
├── gmp
├── libmpc
│ ├── gmp
│ └── mpfr
│ └── gmp
├── mpfr
│ └── gmp
└── i386-elf-binutils
After I installed the gmp#4,mpfr#2,libmpc#0.8,gcc49 ,the error doesn't change .
I installed it using MacPorts and it worked for me:
sudo port install i386-elf-binutils
sudo port install i386-elf-gcc
cd /opt/local/bin
sudo ln -s i386-elf-gcc i386-elf-gcc-4.7.2

Resources